Skip to content

Commit

Permalink
Fix conditions for dispatching JSON handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
MtkN1 committed May 4, 2024
1 parent aa27ad2 commit 10c2461
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pybotters/ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def _onmessage(
for hdlr in hdlr_bytes:
self._loop.call_soon(hdlr, msg.data, ws)

if hdlr_json:
if hdlr_json and msg.type in {aiohttp.WSMsgType.TEXT, aiohttp.WSMsgType.BINARY}:
try:
data = msg.json()
except json.JSONDecodeError as e:
Expand Down

0 comments on commit 10c2461

Please sign in to comment.