Behind Istio that makes all HTTP headers it proxies to applications lowercase, this code here fails, it is using a HashMap and as a result is case sensitive.
https://github.com/usnistgov/jsip/blob/master/src/gov/nist/javax/sip/stack/WebSocketHttpHandshake.java#L114
Fails as it's looking for Sec-WebSocket-Key but the headers HashMap would have sec-websocket-key.
For example:
var test = new HashMap<String, String>();
test.put("sec-lower", "foo");
test.put("Sec-Upper", "bar");
System.out.println("Test: " + test.get("sec-upper"));
System.out.println("Test: " + test.get("sec-lower"));
Outputs:
Interestingly other parts of the code seem to be case insensitively written, e.g.
https://github.com/usnistgov/jsip/blob/master/src/gov/nist/javax/sip/stack/WebSocketHttpHandshake.java#L85
So behind Istio or other proxies that lowercase headers the response Sec-WebSocket-Accept header is always of the value of the string null
Behind Istio that makes all HTTP headers it proxies to applications lowercase, this code here fails, it is using a HashMap and as a result is case sensitive.
https://github.com/usnistgov/jsip/blob/master/src/gov/nist/javax/sip/stack/WebSocketHttpHandshake.java#L114
Fails as it's looking for
Sec-WebSocket-Keybut theheadersHashMapwould havesec-websocket-key.For example:
Outputs:
Interestingly other parts of the code seem to be case insensitively written, e.g.
https://github.com/usnistgov/jsip/blob/master/src/gov/nist/javax/sip/stack/WebSocketHttpHandshake.java#L85
So behind Istio or other proxies that lowercase headers the response
Sec-WebSocket-Acceptheader is always of the value of the stringnull