1
This commit is contained in:
1 parent
730adb3ff2
commit
45b0b3044b
5 files changed
+27
-20
No files matched your search
@@ -36,7 +36,8 @@ ROOT = Path(__file__).resolve().parent
|
||||
DATA_ROOT = ROOT / "web_sim_data"
|
||||
STORE = UserStore(DATA_ROOT)
|
||||
SESSION_COOKIE = "crypto_scam_session"
|
||||
COOKIE_SECURE = "; Secure" if os.environ.get("CRYPTO_SCAM_PUBLIC_HOST") else ""
|
||||
COOKIE_SECURE = ("; Secure" if os.environ.get("CRYPTO_SCAM_PUBLIC_HOST")
|
||||
and os.environ.get("CRYPTO_SCAM_PUBLIC_SCHEME", "https").lower() == "https" else "")
|
||||
HOP_HEADERS = {"connection", "keep-alive", "transfer-encoding", "te", "trailer", "upgrade", "proxy-authorization",
|
||||
"proxy-authenticate", "host", "content-length"}
|
||||
|
||||
@@ -358,10 +359,6 @@ 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