Skip to content

Commit c7c7727

Browse files
author
KaiyiQuan
committed
test(server): assert the SSE server survives a rejected request
1 parent dc135e3 commit c7c7727

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

‎tests/server/test_sse_security.py‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,9 @@ async def test_sse_security_invalid_host_header() -> None:
8989
assert response.text == "Invalid Host header"
9090

9191
# The server process must stay alive after the rejected request: a
92-
# subsequent request to the message endpoint is still served (the
93-
# unknown-session 404 proves routing works rather than hanging).
94-
response = await client.post(
95-
"/messages/?session_id=12345678123456781234567812345678",
96-
headers={"Content-Type": "application/json"},
97-
)
92+
# subsequent request to an unmatched route is still served (404),
93+
# proving the ASGI app did not crash.
94+
response = await client.get("/")
9895
assert response.status_code == 404
9996

10097

0 commit comments

Comments
 (0)