Skip to content

Commit

Permalink
Update uvicorn/protocols/websockets/wsproto_impl.py
Browse files Browse the repository at this point in the history
Co-authored-by: Tom Christie <tom@tomchristie.com>
  • Loading branch information
Kludex and tomchristie committed Oct 29, 2022
1 parent 05dadf7 commit cd9018b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion uvicorn/protocols/websockets/wsproto_impl.py
Expand Up @@ -91,7 +91,9 @@ def data_received(self, data):
self.transport.write(self.conn.send(err.event_hint))
self.transport.close()
else:
self.handle_no_connect(events.CloseConnection(code=1007))
# Response with the "1002 Protocol Error" code.
# See https://www.iana.org/assignments/websocket/websocket.xhtml#close-code-number
self.handle_no_connect(events.CloseConnection(code=1002))
else:
self.handle_events()

Expand Down

0 comments on commit cd9018b

Please sign in to comment.