From 05dadf779f31812ef9143785f64c1d904f1b438f Mon Sep 17 00:00:00 2001 From: Marcelo Trylesinski Date: Tue, 10 May 2022 07:04:04 +0200 Subject: [PATCH] Add code on events.CloseConnection for wsproto --- uvicorn/protocols/websockets/wsproto_impl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uvicorn/protocols/websockets/wsproto_impl.py b/uvicorn/protocols/websockets/wsproto_impl.py index 6e4f505f1..35f88a720 100644 --- a/uvicorn/protocols/websockets/wsproto_impl.py +++ b/uvicorn/protocols/websockets/wsproto_impl.py @@ -91,7 +91,7 @@ def data_received(self, data): self.transport.write(self.conn.send(err.event_hint)) self.transport.close() else: - self.handle_no_connect(events.CloseConnection()) + self.handle_no_connect(events.CloseConnection(code=1007)) else: self.handle_events()