Skip to content

Commit 43c371f

Browse files
committed
Don't fake a close code in close response
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.
1 parent 3546681 commit 43c371f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

websockify/websocket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ def _recvmsg(self):
666666
continue
667667

668668
if code is None:
669-
self.close_code = code = 1005
669+
self.close_code = 1005
670670
self.close_reason = "No close status code specified by peer"
671671
else:
672672
self.close_code = code

0 commit comments

Comments
 (0)