Skip to content

Commit 6807f5b

Browse files
author
Stephane Landelle
committed
minor clean up
1 parent 54950d7 commit 6807f5b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

providers/netty/src/main/java/org/asynchttpclient/providers/netty/handler/WebSocketProtocol.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,10 @@ public void handle(Channel channel, NettyResponseFuture<?> future, Object e) thr
8686

8787
boolean validStatus = response.getStatus().equals(SWITCHING_PROTOCOLS);
8888
boolean validUpgrade = response.headers().get(HttpHeaders.Names.UPGRADE) != null;
89-
String c = response.headers().get(HttpHeaders.Names.CONNECTION);
90-
if (c == null) {
91-
c = response.headers().get(HttpHeaders.Names.CONNECTION.toLowerCase(Locale.ENGLISH));
92-
}
93-
94-
boolean validConnection = c != null && c.equalsIgnoreCase(HttpHeaders.Values.UPGRADE);
89+
String connection = response.headers().get(HttpHeaders.Names.CONNECTION);
90+
if (connection == null)
91+
connection = response.headers().get(HttpHeaders.Names.CONNECTION.toLowerCase(Locale.ENGLISH));
92+
boolean validConnection = HttpHeaders.Values.UPGRADE.equalsIgnoreCase(connection);
9593

9694
status = new NettyResponseStatus(future.getURI(), config, response);
9795
final boolean statusReceived = handler.onStatusReceived(status) == STATE.UPGRADE;

0 commit comments

Comments
 (0)