mirror of
https://github.com/nonebot/nonebot2.git
synced 2026-02-26 20:54:44 +00:00
🐛 Fix: aiohttp 驱动未处理 WSMsgType.CLOSED 类型 (#3862)
This commit is contained in:
@@ -323,7 +323,11 @@ class WebSocket(BaseWebSocket):
|
||||
|
||||
async def _receive(self) -> aiohttp.WSMessage:
|
||||
msg = await self.websocket.receive()
|
||||
if msg.type in (aiohttp.WSMsgType.CLOSE, aiohttp.WSMsgType.CLOSING):
|
||||
if msg.type in (
|
||||
aiohttp.WSMsgType.CLOSE,
|
||||
aiohttp.WSMsgType.CLOSING,
|
||||
aiohttp.WSMsgType.CLOSED,
|
||||
):
|
||||
raise WebSocketClosed(self.websocket.close_code or 1006)
|
||||
return msg
|
||||
|
||||
|
||||
Reference in New Issue
Block a user