SPDY: fix pushed response NullPointerException

This commit is contained in:
Jeff Pinner 2014-07-20 20:00:39 -07:00 committed by Norman Maurer
parent e43df3dd30
commit b35b25aedb

View File

@ -116,6 +116,7 @@ public class SpdyHttpDecoder extends OneToOneDecoder {
} }
String URL = SpdyHeaders.getUrl(spdyVersion, spdySynStreamFrame); String URL = SpdyHeaders.getUrl(spdyVersion, spdySynStreamFrame);
SpdyHeaders.removeUrl(spdyVersion, spdySynStreamFrame);
// If a client receives a SYN_STREAM without a 'url' header // If a client receives a SYN_STREAM without a 'url' header
// it must reply with a RST_STREAM with error code PROTOCOL_ERROR // it must reply with a RST_STREAM with error code PROTOCOL_ERROR
@ -308,12 +309,10 @@ public class SpdyHttpDecoder extends OneToOneDecoder {
// Remove the scheme header // Remove the scheme header
SpdyHeaders.removeScheme(spdyVersion, requestFrame); SpdyHeaders.removeScheme(spdyVersion, requestFrame);
if (spdyVersion >= 3) { // Replace the SPDY host header with the HTTP host header
// Replace the SPDY host header with the HTTP host header String host = SpdyHeaders.getHost(requestFrame);
String host = SpdyHeaders.getHost(requestFrame); SpdyHeaders.removeHost(requestFrame);
SpdyHeaders.removeHost(requestFrame); HttpHeaders.setHost(httpRequest, host);
HttpHeaders.setHost(httpRequest, host);
}
for (Map.Entry<String, String> e: requestFrame.headers()) { for (Map.Entry<String, String> e: requestFrame.headers()) {
httpRequest.headers().add(e.getKey(), e.getValue()); httpRequest.headers().add(e.getKey(), e.getValue());