Case-insensitive matching for Upgrade and Connection header (#278)
This commit is contained in:
parent
1d7067719b
commit
ec43aa121f
@ -200,13 +200,13 @@ public class WebSocketClientHandshaker00 extends WebSocketClientHandshaker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String upgrade = response.getHeader(Names.UPGRADE);
|
String upgrade = response.getHeader(Names.UPGRADE);
|
||||||
if (upgrade == null || !upgrade.equals(Values.WEBSOCKET)) {
|
if (upgrade == null || !upgrade.equalsIgnoreCase(Values.WEBSOCKET)) {
|
||||||
throw new WebSocketHandshakeException("Invalid handshake response upgrade: "
|
throw new WebSocketHandshakeException("Invalid handshake response upgrade: "
|
||||||
+ response.getHeader(Names.UPGRADE));
|
+ response.getHeader(Names.UPGRADE));
|
||||||
}
|
}
|
||||||
|
|
||||||
String connection = response.getHeader(Names.CONNECTION);
|
String connection = response.getHeader(Names.CONNECTION);
|
||||||
if (connection == null || !connection.equals(Values.UPGRADE)) {
|
if (connection == null || !connection.equalsIgnoreCase(Values.UPGRADE)) {
|
||||||
throw new WebSocketHandshakeException("Invalid handshake response connection: "
|
throw new WebSocketHandshakeException("Invalid handshake response connection: "
|
||||||
+ response.getHeader(Names.CONNECTION));
|
+ response.getHeader(Names.CONNECTION));
|
||||||
}
|
}
|
||||||
|
@ -178,13 +178,13 @@ public class WebSocketClientHandshaker08 extends WebSocketClientHandshaker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String upgrade = response.getHeader(Names.UPGRADE);
|
String upgrade = response.getHeader(Names.UPGRADE);
|
||||||
if (upgrade == null || !upgrade.equals(Values.WEBSOCKET.toLowerCase())) {
|
if (upgrade == null || !upgrade.equalsIgnoreCase(Values.WEBSOCKET)) {
|
||||||
throw new WebSocketHandshakeException("Invalid handshake response upgrade: "
|
throw new WebSocketHandshakeException("Invalid handshake response upgrade: "
|
||||||
+ response.getHeader(Names.UPGRADE));
|
+ response.getHeader(Names.UPGRADE));
|
||||||
}
|
}
|
||||||
|
|
||||||
String connection = response.getHeader(Names.CONNECTION);
|
String connection = response.getHeader(Names.CONNECTION);
|
||||||
if (connection == null || !connection.equals(Values.UPGRADE)) {
|
if (connection == null || !connection.equalsIgnoreCase(Values.UPGRADE)) {
|
||||||
throw new WebSocketHandshakeException("Invalid handshake response connection: "
|
throw new WebSocketHandshakeException("Invalid handshake response connection: "
|
||||||
+ response.getHeader(Names.CONNECTION));
|
+ response.getHeader(Names.CONNECTION));
|
||||||
}
|
}
|
||||||
|
@ -178,13 +178,13 @@ public class WebSocketClientHandshaker13 extends WebSocketClientHandshaker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String upgrade = response.getHeader(Names.UPGRADE);
|
String upgrade = response.getHeader(Names.UPGRADE);
|
||||||
if (upgrade == null || !upgrade.equals(Values.WEBSOCKET.toLowerCase())) {
|
if (upgrade == null || !upgrade.equalsIgnoreCase(Values.WEBSOCKET)) {
|
||||||
throw new WebSocketHandshakeException("Invalid handshake response upgrade: "
|
throw new WebSocketHandshakeException("Invalid handshake response upgrade: "
|
||||||
+ response.getHeader(Names.UPGRADE));
|
+ response.getHeader(Names.UPGRADE));
|
||||||
}
|
}
|
||||||
|
|
||||||
String connection = response.getHeader(Names.CONNECTION);
|
String connection = response.getHeader(Names.CONNECTION);
|
||||||
if (connection == null || !connection.equals(Values.UPGRADE)) {
|
if (connection == null || !connection.equalsIgnoreCase(Values.UPGRADE)) {
|
||||||
throw new WebSocketHandshakeException("Invalid handshake response connection: "
|
throw new WebSocketHandshakeException("Invalid handshake response connection: "
|
||||||
+ response.getHeader(Names.CONNECTION));
|
+ response.getHeader(Names.CONNECTION));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user