Open gthb opened 1 week ago
Sounds good, I'll fix it, but your Socket.IO client is faulty if it is sending POST request without a sid
.
Sounds good, I'll fix it, but your Socket.IO client is faulty if it is sending POST request without a
sid
.
It sure is :) — addressing that, but obviously out of scope here.
Describe the bug
In
async_server.handle_request
, thePOST
case does this:but in the
sid is None
case, this will always raise aTypeError
(before callingself._log_error_once
) saying “can only concatenate str (not "NoneType") to str”, resulting in a 500 Internal Server response being sent, instead of the obviously intended 400 Bad Request response.To Reproduce
Send to an
AsyncServer
(in our case in uvicorn 0.20.0) a POST request with a query string containingEIO=4
and nosid
query parameter, for examplePOST /socket.io5/?EIO=4&transport=websocket HTTP/1.1
.This error is raised:
The resulting behavior is that a 500 Internal Server Error response is sent.
Expected behavior
A 400 Bad Request response should be sent.
Logs