Skip to content

Commit

Permalink
Don't fake a close code in close response
Browse files Browse the repository at this point in the history
If the peer doesn't send us a close code, then don't send any code back
in the response. Sending 1005 is explicitly wrong as the specification
states that code should only be used locally and never be sent over the
network.
  • Loading branch information
CendioOssman committed Sep 6, 2023
1 parent 3546681 commit 43c371f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion websockify/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ def _recvmsg(self):
continue

if code is None:
self.close_code = code = 1005
self.close_code = 1005
self.close_reason = "No close status code specified by peer"
else:
self.close_code = code
Expand Down

0 comments on commit 43c371f

Please sign in to comment.