1
This commit is contained in:
1 parent
3ae4e18211
commit
730adb3ff2
9 files changed
+206
-33
No files matched your search
@@ -358,6 +358,10 @@ class Proxy(BaseHTTPRequestHandler):
|
||||
headers = {k: v for k, v in self.headers.items() if k.lower() not in HOP_HEADERS}
|
||||
# Preserve the validated authority so the engine can compare the browser Origin.
|
||||
headers["Host"] = self.headers["Host"]
|
||||
# Forward only the scheme validated at this proxy boundary. The engine repeats
|
||||
# the host/origin checks and must know TLS terminated at the external gateway.
|
||||
if self.headers.get("X-Forwarded-Proto", "").lower() == "https":
|
||||
headers["X-Forwarded-Proto"] = "https"
|
||||
req = urllib.request.Request(ENGINE + self.path, data=body, method=method, headers=headers)
|
||||
try:
|
||||
with urllib.request.urlopen(req, timeout=30) as resp:
|
||||
|
||||
Reference in new issue
Block a user