Add CLOSED as an expected type (#83180)
This commit is contained in:
parent
6cef37641c
commit
0dfc0af08c
1 changed files with 2 additions and 2 deletions
|
@ -214,7 +214,7 @@ class WebSocketHandler:
|
|||
disconnect_warn = "Did not receive auth message within 10 seconds"
|
||||
raise Disconnect from err
|
||||
|
||||
if msg.type in (WSMsgType.CLOSE, WSMsgType.CLOSING):
|
||||
if msg.type in (WSMsgType.CLOSE, WSMsgType.CLOSED, WSMsgType.CLOSING):
|
||||
raise Disconnect
|
||||
|
||||
if msg.type != WSMsgType.TEXT:
|
||||
|
@ -238,7 +238,7 @@ class WebSocketHandler:
|
|||
while not wsock.closed:
|
||||
msg = await wsock.receive()
|
||||
|
||||
if msg.type in (WSMsgType.CLOSE, WSMsgType.CLOSING):
|
||||
if msg.type in (WSMsgType.CLOSE, WSMsgType.CLOSED, WSMsgType.CLOSING):
|
||||
break
|
||||
|
||||
if msg.type != WSMsgType.TEXT:
|
||||
|
|
Loading…
Add table
Reference in a new issue