diff options
| author | engn33r <engn33r@users.noreply.github.com> | 2021-03-07 22:07:12 -0500 |
|---|---|---|
| committer | engn33r <engn33r@users.noreply.github.com> | 2021-03-07 22:07:12 -0500 |
| commit | df87514c7cbc202e5e469f775daea8c3bf972fff (patch) | |
| tree | 349e99e52c112e7cf1e890f41830631343798208 | |
| parent | fd64148907a8cd18fd31e2447f58721355c6106d (diff) | |
| download | websocket-client-df87514c7cbc202e5e469f775daea8c3bf972fff.tar.gz | |
Fix #639 by adding close branch for reserved custom status codes
| -rw-r--r-- | websocket/_core.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/websocket/_core.py b/websocket/_core.py index f832cad..a3e484b 100644 --- a/websocket/_core.py +++ b/websocket/_core.py @@ -478,7 +478,9 @@ class WebSocket(object): continue if isEnabledForError(): recv_status = struct.unpack("!H", frame.data[0:2])[0] - if recv_status != STATUS_NORMAL: + if recv_status >= 3000 and recv_status <= 4999: + debug("close status: " + repr(recv_status)) + elif recv_status != STATUS_NORMAL: error("close status: " + repr(recv_status)) break except: |
