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:
parent
354668143f
commit
43c371fc7a
|
|
@ -666,7 +666,7 @@ class WebSocket(object):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if code is None:
|
if code is None:
|
||||||
self.close_code = code = 1005
|
self.close_code = 1005
|
||||||
self.close_reason = "No close status code specified by peer"
|
self.close_reason = "No close status code specified by peer"
|
||||||
else:
|
else:
|
||||||
self.close_code = code
|
self.close_code = code
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue