Skip to content

Commit b495799

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

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎tests/server/test_sse_security.py‎

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

91+
# 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("/messages/?session_id=12345678123456781234567812345678")
95+
assert response.status_code == 404
96+
9197

9298
@pytest.mark.anyio
9399
async def test_sse_security_invalid_origin_header() -> None:

0 commit comments

Comments
 (0)