Skip to content

Commit 53d5e52

Browse files
Kludextomchristie
andauthored
Update uvicorn/protocols/websockets/wsproto_impl.py
Co-authored-by: Tom Christie <[email protected]>
1 parent ea5e5c7 commit 53d5e52

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

uvicorn/protocols/websockets/wsproto_impl.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ def data_received(self, data):
8686
self.transport.write(self.conn.send(err.event_hint))
8787
self.transport.close()
8888
else:
89-
self.handle_no_connect(events.CloseConnection(code=1007))
89+
# Response with the "1002 Protocol Error" code.
90+
# See https://www.iana.org/assignments/websocket/websocket.xhtml#close-code-number
91+
self.handle_no_connect(events.CloseConnection(code=1002))
9092
else:
9193
self.handle_events()
9294

0 commit comments

Comments
 (0)