Remove unnecessary null check before equals()
This commit is contained in:
parent
ff03df6851
commit
f4585b9f53
@ -228,13 +228,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 (Values.WEBSOCKET.equals(upgrade)) {
|
||||||
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 (Values.UPGRADE.equals(connection)) {
|
||||||
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