[#4095] Correctly handle Upgrade responses with special handling of Hixie 76

Motivation:

Hixie 76 needs special handling compared to other connection upgrade responses. Our detection code of non websocket responses did actually always use the special handling that only should be used for Hixie 76 responses.

Modifications:

Correctly detect connection upgrade responses which are not for websockets.

Result:

Be able to upgrade connections for other protocols then websockets.
This commit is contained in:
Norman Maurer 2015-08-17 15:23:31 +02:00
parent 24bcc11095
commit 9a445206ca

View File

@ -459,7 +459,8 @@ public abstract class HttpObjectDecoder extends ByteToMessageDecoder {
// - https://github.com/netty/netty/issues/222
if (code >= 100 && code < 200) {
// One exception: Hixie 76 websocket handshake response
return !(code == 101 && !res.headers().contains(HttpHeaders.Names.SEC_WEBSOCKET_ACCEPT));
return !(code == 101 && !res.headers().contains(HttpHeaders.Names.SEC_WEBSOCKET_ACCEPT)
&& res.headers().contains(HttpHeaders.Names.UPGRADE, HttpHeaders.Values.WEBSOCKET, true));
}
switch (code) {