Closed iris-ersc closed 4 years ago
Thanks for reporting.
According the RFC6455 it's best to return 426 Upgrade Required. I'll have a look at it.
I have opened #132 to address this issue. It does handle any parsing errors now. In case of an empty header there's a entry in the log now.
PR merged.
While working with seasocks and testing with
curl
I came across some (maybe) unwanted behavior:When there is no "Sec-WebSocket-Version" header field, seasocks throws a
invalid_argument
exception.The header field "Sec-WebSocket-Version" is mandatory according to the WebSocket Protocol, but crashing the whole webserver because a simple
std::stoi
operates on an empty string is probably not good.https://github.com/mattgodbolt/seasocks/blob/ec3558d66e7bed7b9d1f502c4171730668a8eb59/src/main/c/Connection.cpp#L920