You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While I was testing socket.io integration with uvicorn I ran into an issue with CORS. When you do not supply the argument cors_allowed_origins the error RuntimeWarning: coroutine 'make_response' was never awaited occurs and the server returns 500 error. If you supply cors_allowed_origins=[] with an empty array, everything works but not as expected. The client from another domain makes the connection without being in the allowed origins list.
INFO: Started server process [24304]
INFO: Uvicorn running on http://127.0.0.1:6270 (Press CTRL+C to quit)
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: ('127.0.0.1', 61948) - "WebSocket /socket.io/" [accepted]
C:\Users\x\.virtualenvs\sio-test-SdSnYm_O\lib\site-packages\engineio\async_drivers\asgi.py:46: RuntimeWarning: coroutine 'make_response' was never awaited
await self.engineio_server.handle_request(scope, receive, send)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
INFO: ('127.0.0.1', 61970) - "WebSocket /socket.io/" [accepted]
INFO: ('127.0.0.1', 61985) - "WebSocket /socket.io/" [accepted]
INFO: Shutting down
INFO: Waiting for application shutdown.
INFO: Application shutdown complete.
INFO: Finished server process [24304]
If you remove the comment from the code above anything is accepted, but if you provide 1 host in the list that does not match the request host you get the same error as above.
I am not sure if placing an await in front of make_response on line 203 of asyncio_server.py is the full solution as I got other errors with uvicorn. Please let me know if you need additional information on the issue.
My Environment:
Windows 10
Python: 3.8.0
The text was updated successfully, but these errors were encountered:
While I was testing socket.io integration with uvicorn I ran into an issue with CORS. When you do not supply the argument cors_allowed_origins the error RuntimeWarning: coroutine 'make_response' was never awaited occurs and the server returns 500 error. If you supply cors_allowed_origins=[] with an empty array, everything works but not as expected. The client from another domain makes the connection without being in the allowed origins list.
Server side code to produce the issue:
Generated Error:
If you remove the comment from the code above anything is accepted, but if you provide 1 host in the list that does not match the request host you get the same error as above.
I am not sure if placing an await in front of make_response on line 203 of asyncio_server.py is the full solution as I got other errors with uvicorn. Please let me know if you need additional information on the issue.
My Environment:
Windows 10
Python: 3.8.0
The text was updated successfully, but these errors were encountered: