Skip to content

Commit

Permalink
Remove location header transformation that never really worked
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmark committed Aug 21, 2022
1 parent d485760 commit 2517b1a
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ def get(path):
resp = session.get(url, params=request.args, headers=headers)
if "content-type" in resp.headers.keys():
g.content_type = resp.headers["Content-Type"]
print("Content-type in response header: " + g.content_type)
if "location" in resp.headers.keys():
g.location = resp.headers["Location"].replace("https://", "http://", 1)
print("Location in response header: " + g.location)
if resp.headers["Content-Type"].startswith("text/html"):
return transcode_html(
resp.content,
Expand All @@ -58,10 +54,6 @@ def post(path):
resp = session.post(url, data=request.form, headers=headers, allow_redirects=True)
if "content-type" in resp.headers.keys():
g.content_type = resp.headers["Content-Type"]
print("Content-type in response header: " + g.content_type)
if "location" in resp.headers.keys():
g.location = resp.headers["Location"].replace("https://", "http://", 1)
print("Location in response header: " + g.location)
if resp.headers["Content-Type"].startswith("text/html"):
return transcode_html(
resp.content,
Expand All @@ -81,10 +73,6 @@ def apply_caching(resp):
resp.headers["Content-Type"] = g.content_type
except:
pass
try:
resp.headers["Location"] = g.location
except:
pass
return resp

if __name__ == "__main__":
Expand Down

0 comments on commit 2517b1a

Please sign in to comment.