Skip to content

Commit 3575cba

Browse files
authored
Add content-length to 500 response in wsproto (#2542)
1 parent a500513 commit 3575cba

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

uvicorn/protocols/websockets/wsproto_impl.py

+1
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ def send_500_response(self) -> None:
224224
headers: list[tuple[bytes, bytes]] = [
225225
(b"content-type", b"text/plain; charset=utf-8"),
226226
(b"connection", b"close"),
227+
(b"content-length", b"21"),
227228
]
228229
output = self.conn.send(wsproto.events.RejectConnection(status_code=500, headers=headers, has_body=True))
229230
output += self.conn.send(wsproto.events.RejectData(data=b"Internal Server Error"))

0 commit comments

Comments
 (0)