You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the per message compression is active the websocket client sends an illegal header to the server and the server (in my case Java Jetty) closes the connection with "HTTP/1.1 400 Illegal character CNTL=0xf".
This is caused by using an uint8_t for server_max_window_bits and client_max_window_bits in WebSocketPerMessageDeflateOptions.
A uint8_t is actually a "signed char" and so the byte value is interpreted as a character when building the headers.
Instead of ... ; server_max_window_bits=15; client_max_window_bits=15
the client sends ...; server_max_window_bits=\xf; client-max_window_bits=\xf
The ws tool can be used to show this. You can see the defect header with Wireshark. ws send ws://localhost:8081/mywebsocket IXWebSocket/ws/ws.cpp
The ws tool's "receive" mode hides this bug because it uses strtol() to parse the presumed number and just returns zero because \xf is not a digit. The zero is then range-checked to the minimum window bits value (8).
The text was updated successfully, but these errors were encountered:
If the per message compression is active the websocket client sends an illegal header to the server and the server (in my case Java Jetty) closes the connection with "HTTP/1.1 400 Illegal character CNTL=0xf".
This is caused by using an uint8_t for server_max_window_bits and client_max_window_bits in WebSocketPerMessageDeflateOptions.
A uint8_t is actually a "signed char" and so the byte value is interpreted as a character when building the headers.
Instead of
... ; server_max_window_bits=15; client_max_window_bits=15
the client sends
...; server_max_window_bits=\xf; client-max_window_bits=\xf
The ws tool can be used to show this. You can see the defect header with Wireshark.
ws send ws://localhost:8081/mywebsocket IXWebSocket/ws/ws.cpp
The ws tool's "receive" mode hides this bug because it uses strtol() to parse the presumed number and just returns zero because \xf is not a digit. The zero is then range-checked to the minimum window bits value (8).
The text was updated successfully, but these errors were encountered: