Skip to content

Commit

Permalink
RemoteProtocolError always have an event_hint
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex committed Oct 29, 2022
1 parent cd9018b commit 79129ae
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions uvicorn/protocols/websockets/wsproto_impl.py
Expand Up @@ -89,11 +89,7 @@ def data_received(self, data):
except RemoteProtocolError as err:
if err.event_hint is not None:
self.transport.write(self.conn.send(err.event_hint))
self.transport.close()
else:
# 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))
self.transport.close()
else:
self.handle_events()

Expand Down

0 comments on commit 79129ae

Please sign in to comment.