| author | |
| committer | |
| log | e17dfb9da0bee4c1f118e0a72b88f29f43365f61 |
| tree | ab03fa52330f81c8a5069df9bb2b615282f4687d |
| parent | 54611e32d76e97c1f3145f4a14221668e70d52fb |
I've seen implementations in the wild that send 'Upgrade: WebSocket',
which currently fails the handshake.
From https://datatracker.ietf.org/doc/html/rfc6455:
"If the response lacks an |Upgrade| header field or the |Upgrade| header
field contains a value that is not an ASCII case-insensitive match for
the value "websocket", the client MUST _Fail the WebSocket Connection_."1 files changed, 1 insertions(+), 1 deletions(-)
lib/std/http/WebSocket.zig+1-1| ... | ... | @@ -30,7 +30,7 @@ pub fn init( |
| 30 | 30 | if (std.ascii.eqlIgnoreCase(header.name, "sec-websocket-key")) { |
| 31 | 31 | sec_websocket_key = header.value; |
| 32 | 32 | } else if (std.ascii.eqlIgnoreCase(header.name, "upgrade")) { |
| 33 | if (!std.mem.eql(u8, header.value, "websocket")) | |
| 33 | if (!std.ascii.eqlIgnoreCase(header.value, "websocket")) | |
| 34 | 34 | return false; |
| 35 | 35 | upgrade_websocket = true; |
| 36 | 36 | } |