Harden forwarded IP parsing for auth throttling

This commit is contained in:
Jage9
2026-03-02 00:41:58 -05:00
parent 26d6bafce0
commit 873b00e070
2 changed files with 5 additions and 2 deletions

View File

@@ -30,7 +30,7 @@ def test_client_ip_prefers_forwarded_for_from_loopback_proxy() -> None:
ServerConnection,
SimpleNamespace(
remote_address=("127.0.0.1", 12345),
request=SimpleNamespace(headers={"X-Forwarded-For": "198.51.100.25, 127.0.0.1"}),
request=SimpleNamespace(headers={"X-Forwarded-For": "203.0.113.10, 198.51.100.25"}),
),
)
client = ClientConnection(websocket=ws, id="u1", nickname="tester")