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()