fix: add X-Forwarded-Proto header

This commit is contained in:
2026-04-20 23:04:18 +02:00
parent 96cf1f394b
commit ac94704c9e
2 changed files with 27 additions and 13 deletions
+24 -12
View File
@@ -756,11 +756,13 @@ class TestRequestHandler(BaseHandlerTestCase):
"data": None,
"headers": {
"Host": "example.com",
"X-Real-IP": "127.0.0.1",
"X-Forwarded-Host": "localhost",
"X-Forwarded-For": "127.0.0.1",
"X-Real-IP": "127.0.0.1",
"X-Forwarded-Proto": "https",
},
"timeout": 240,
"allow_redirects": True,
"timeout": 480,
},
),
self.expects_status_only(handler, 200, "OK"),
@@ -796,12 +798,14 @@ class TestRequestHandler(BaseHandlerTestCase):
"data": b"hello",
"headers": {
"Host": "example.com",
"X-Real-IP": "127.0.0.1",
"X-Forwarded-Host": "localhost",
"X-Forwarded-For": "127.0.0.1",
"X-Real-IP": "127.0.0.1",
"X-Forwarded-Proto": "https",
"Content-Length": "5",
},
"timeout": 240,
"allow_redirects": True,
"timeout": 480,
},
),
self.expects_status_only(handler, 200, "OK"),
@@ -836,11 +840,13 @@ class TestRequestHandler(BaseHandlerTestCase):
"data": None,
"headers": {
"Host": "example.com",
"X-Real-IP": "127.0.0.1",
"X-Forwarded-Host": "localhost",
"X-Forwarded-For": "127.0.0.1",
"X-Real-IP": "127.0.0.1",
"X-Forwarded-Proto": "https",
},
"timeout": 240,
"allow_redirects": True,
"timeout": 480,
},
),
self.expects_basic_body(handler, "hello", message="OK"),
@@ -867,11 +873,13 @@ class TestRequestHandler(BaseHandlerTestCase):
"data": None,
"headers": {
"Host": "example.com",
"X-Real-IP": "127.0.0.1",
"X-Forwarded-Host": "localhost",
"X-Forwarded-For": "127.0.0.1",
"X-Real-IP": "127.0.0.1",
"X-Forwarded-Proto": "https",
},
"timeout": 240,
"allow_redirects": True,
"timeout": 480,
},
) as request_mock,
self.expects_status_only(
@@ -907,11 +915,13 @@ class TestRequestHandler(BaseHandlerTestCase):
"data": None,
"headers": {
"Host": "example.com",
"X-Real-IP": "127.0.0.1",
"X-Forwarded-Host": "localhost",
"X-Forwarded-For": "127.0.0.1",
"X-Real-IP": "127.0.0.1",
"X-Forwarded-Proto": "https",
},
"timeout": 240,
"allow_redirects": True,
"timeout": 480,
},
),
self.expects_status_only(handler, 200, "OK"),
@@ -944,11 +954,13 @@ class TestRequestHandler(BaseHandlerTestCase):
"data": None,
"headers": {
"Host": "example.com",
"X-Real-IP": "127.0.0.1",
"X-Forwarded-Host": "host",
"X-Forwarded-For": "127.0.0.1",
"X-Real-IP": "127.0.0.1",
"X-Forwarded-Proto": "https",
},
"timeout": 240,
"allow_redirects": True,
"timeout": 480,
},
),
self.expects_status_only(handler, 200, "OK"),