Added missing "reason" to ensure backward compatibility
Reason added for Informational response to socket connection upgrade. This ensures backwards compatibility for older socket libraries like: OCaml/websokets
Please add a test to make sure we don't regress in the future.
I couldn't find an explicit statement in RFC6455 about mandating exactly this reason - though if you are reporting that some clients are expecting exactly this reason, I think its valid to define it as default - and until somebody requests otherwise - not configurable.
@mhils have you seen issues around this also with mitmproxy?
I've seen problems with missing reason phrases before, not in this specific context.
In mitmproxy we just forward as-is and internally operate on the status code only.
for reference: this is the section in RFC6455 that mentions Switching Protocols:
https://datatracker.ietf.org/doc/html/rfc6455#section-1.2
https://datatracker.ietf.org/doc/html/rfc6455#section-1.3
A Status-Line with a 101 response code as per RFC 2616 [RFC2616]. Such a response could look like "HTTP/1.1 101 Switching Protocols".