userver-framework / userver

Production-ready C++ Asynchronous Framework with rich functionality
https://userver.tech
Apache License 2.0
2.37k stars 275 forks source link

Websocket http connection headers: connection, upgrade MUST be case insensitive, key MUST have len eq 16 #655

Closed Turim closed 1 month ago

Turim commented 1 month ago

PTAL Websocket RFC 6455

4.2.1
...
   3.   An |Upgrade| header field containing the value "websocket",
        treated as an ASCII case-insensitive value.
   4.   A |Connection| header field that includes the token "Upgrade",
        treated as an ASCII case-insensitive value.
   5.   A |Sec-WebSocket-Key| header field with a base64-encoded (see
        [Section 4 of [RFC4648]](https://datatracker.ietf.org/doc/html/rfc4648#section-4)) value that, when decoded, is 16 bytes in
        length.

The sibling of: https://github.com/processone/ejabberd/issues/510 https://github.com/fasthttp/websocket/issues/15 etc

Upd. 24.07.2024: I've added 5. (key) to kill 2 birds with one stone may be.