Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #45 from EOEPCA/release/v0.2
Browse files Browse the repository at this point in the history
Release/v0.2
  • Loading branch information
TiagoMF20 authored Nov 16, 2020
2 parents b9982c8 + f88a7e4 commit accca00
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,9 @@ def proxy_request(request, new_header):
excluded_headers = ['transfer-encoding']
headers = [(name, value) for (name, value) in res.raw.headers.items() if name.lower() not in excluded_headers]
response = Response(res.content, res.status_code, headers)
response.autocorrect_location_header = False
response.headers["Location"] = g_config["proxy_endpoint"] + response.headers["Location"].replace(g_config["resource_server_endpoint"], '')
if "Location" in response.headers:
response.autocorrect_location_header = False
response.headers["Location"] = g_config["proxy_endpoint"] + response.headers["Location"].replace(g_config["resource_server_endpoint"], '')
return response
except Exception as e:
response = Response()
Expand Down

0 comments on commit accca00

Please sign in to comment.