Restore rolls back to a backup; a session can only file issues in another project #220

Merged
bvandeusen merged 15 commits from dev into main 2026-11-05 09:29:55 -05:00
Showing only changes of commit 3c01e17559 - Show all commits
+5 -6
View File
@@ -50,9 +50,10 @@ def _app() -> Quart:
def _context(app, headers=None, scheme="http"):
# Quart's ASGI layer writes the socket peer into a Remote-Addr header,
# replacing any the client sent; a test request context takes it as given.
return app.test_request_context(
"/", headers=headers or {}, scheme=scheme,
scope_base={"client": (PEER, 40000)},
"/", headers={"Remote-Addr": PEER, **(headers or {})}, scheme=scheme,
)
@@ -76,10 +77,8 @@ async def test_no_header_reads_the_socket_peer(monkeypatch):
async def test_a_header_sent_twice_is_read_as_one_chain(monkeypatch):
monkeypatch.setattr(Config, "TRUSTED_PROXY_HOPS", 1)
headers = [("X-Forwarded-For", FORGED), ("X-Forwarded-For", CLIENT)]
async with _app().test_request_context(
"/", headers=headers, scope_base={"client": (PEER, 40000)},
):
headers = [("Remote-Addr", PEER), ("X-Forwarded-For", FORGED), ("X-Forwarded-For", CLIENT)]
async with _app().test_request_context("/", headers=headers):
assert client_ip() == CLIENT