Skip to content

Commit

Permalink
SPDY: fix pushed response NullPointerException
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Pinner authored and Norman Maurer committed Jul 21, 2014
1 parent 860e475 commit 6935c07
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ protected void decode(ChannelHandlerContext ctx, SpdyFrame msg, List<Object> 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
Expand Down Expand Up @@ -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<String, String> e: requestFrame.headers()) {
req.headers().add(e.getKey(), e.getValue());
Expand Down

0 comments on commit 6935c07

Please sign in to comment.