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.
This commit is contained in:
@@ -666,7 +666,7 @@ class WebSocket(object):
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user