Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
passbook
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
List
Boards
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
External Wiki
External Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BeryJu.org
passbook
Commits
3d1fa9f0
Commit
3d1fa9f0
authored
Jul 09, 2019
by
Langhammer, Jens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app_gw: Rewrite redirect responses (replace upstream location with server_name)
parent
1d2be6e6
Pipeline
#3895
passed with stage
in 2 minutes and 19 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
passbook/app_gw/proxy/handler.py
passbook/app_gw/proxy/handler.py
+8
-0
passbook/app_gw/proxy/response.py
passbook/app_gw/proxy/response.py
+1
-1
No files found.
passbook/app_gw/proxy/handler.py
View file @
3d1fa9f0
...
...
@@ -221,5 +221,13 @@ class RequestHandler:
self
.
_set_content_type
(
proxy_response
)
response
=
get_django_response
(
proxy_response
,
strict_cookies
=
False
)
# If response has a 'Location' header, we rewrite that location as well
if
'Location'
in
response
:
LOGGER
.
debug
(
"Rewriting Location header"
)
for
server_name
in
self
.
app_gw
.
server_name
:
response
[
'Location'
]
=
response
[
'Location'
]
.
replace
(
self
.
_parsed_url
.
hostname
,
server_name
)
LOGGER
.
debug
(
response
[
'Location'
])
# LOGGER.debug("RESPONSE RETURNED: %s", response)
return
response
passbook/app_gw/proxy/response.py
View file @
3d1fa9f0
...
...
@@ -9,7 +9,7 @@ from passbook.app_gw.proxy.utils import (cookie_from_string,
#: Default number of bytes that are going to be read in a file lecture
DEFAULT_AMT
=
2
**
16
logger
=
logging
.
getLogger
(
'revproxy.response'
)
logger
=
logging
.
getLogger
(
__name__
)
def
get_django_response
(
proxy_response
,
strict_cookies
=
False
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment