Skip to content

Commit

Permalink
fix event loop bug with aiohttp 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
wang0618 committed Nov 5, 2021
1 parent 3869738 commit 952a60b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pywebio/platform/aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ def _webio_handler(applications, cdn, websocket_settings, check_origin_func=_is_
:param callable check_origin_func: check_origin_func(origin, host) -> bool
:return: aiohttp Request Handler
"""
ioloop = asyncio.get_event_loop()

async def wshandle(request: web.Request):
ioloop = asyncio.get_event_loop()

origin = request.headers.get('origin')
if origin and not check_origin_func(origin=origin, host=request.host):
return web.Response(status=403, text="Cross origin websockets not allowed")
Expand Down

0 comments on commit 952a60b

Please sign in to comment.