libhtp
libhtp copied to clipboard
Supporting 101 Switching Protocols
Related to #13 which was closed for no apparent reason.
As soon as server replies with 101 Switching Protocols, anything after HTTP headers is no longer HTTP protocol.
The server will switch protocols to those defined by the response's Upgrade header field immediately after the empty line which terminates the 101 response.
libhtp seems to ignore this status code, still trying to parse everything that comes after as HTTP data.
This leads to WebSocket traffic being interpreted as some junk requests/responses (I will attach some pcaps a bit later, if needed).
I believe the correct solution would be to stop tracking HTTP connection after 101 response, unless specific protocol can be actually supported.
I've started working on implementing this. As libhtp already does something similar with CONNECT requests, it shouldn't be very hard.
Is this still an issue ? (I do not think so)