Add websocket 500 fallback header test (#2874)
## Summary - extend the invalid websocket HTTP response regression test - assert the 500 fallback includes content-length and connection headers ## Testing - uv run pytest tests/protocols/test_websocket.py -k invalid_status -q
This commit is contained in:
parent
28efbb24bd
commit
1cb8e747e2
@ -883,6 +883,8 @@ async def test_server_reject_connection_with_invalid_status(
|
||||
response = await wsresponse(url)
|
||||
assert response.status_code == 500
|
||||
assert response.content == b"Internal Server Error"
|
||||
assert response.headers["content-length"] == "21"
|
||||
assert response.headers["connection"] == "close"
|
||||
|
||||
config = Config(app=app, ws=ws_protocol_cls, http=http_protocol_cls, lifespan="off", port=unused_tcp_port)
|
||||
async with run_server(config):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user