From 6935c07ce1cfe89a61638d194694b2ef0afe12b4 Mon Sep 17 00:00:00 2001 From: Jeff Pinner Date: Sun, 20 Jul 2014 19:43:02 -0700 Subject: [PATCH] SPDY: fix pushed response NullPointerException --- .../io/netty/handler/codec/spdy/SpdyHttpDecoder.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyHttpDecoder.java b/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyHttpDecoder.java index ad521e6ad39f..9d7d6e6c7608 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyHttpDecoder.java +++ b/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyHttpDecoder.java @@ -146,6 +146,7 @@ protected void decode(ChannelHandlerContext ctx, SpdyFrame msg, List out } String URL = spdySynStreamFrame.headers().get(PATH); + spdySynStreamFrame.headers().remove(PATH); // If a client receives a SYN_STREAM without a 'url' header // it must reply with a RST_STREAM with error code PROTOCOL_ERROR @@ -338,12 +339,10 @@ private static FullHttpRequest createHttpRequest(int spdyVersion, SpdyHeadersFra // Remove the scheme header headers.remove(SCHEME); - if (spdyVersion >= 3) { - // Replace the SPDY host header with the HTTP host header - String host = headers.get(HOST); - headers.remove(HOST); - req.headers().set(HttpHeaders.Names.HOST, host); - } + // Replace the SPDY host header with the HTTP host header + String host = headers.get(HOST); + headers.remove(HOST); + req.headers().set(HttpHeaders.Names.HOST, host); for (Map.Entry e: requestFrame.headers()) { req.headers().add(e.getKey(), e.getValue());