SPDY: fix pushed response NullPointerException
This commit is contained in:
parent
eb34cbb2d8
commit
6d0233d3bd
@ -322,6 +322,7 @@ public class SpdyHttpDecoder extends MessageToMessageDecoder<SpdyFrame> {
|
|||||||
private static FullHttpRequest createHttpRequest(int spdyVersion, SpdyHeadersFrame requestFrame)
|
private static FullHttpRequest createHttpRequest(int spdyVersion, SpdyHeadersFrame requestFrame)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
// Create the first line of the request from the name/value pairs
|
// Create the first line of the request from the name/value pairs
|
||||||
|
SpdyHeaders headers = requestFrame.headers();
|
||||||
HttpMethod method = SpdyHeaders.getMethod(spdyVersion, requestFrame);
|
HttpMethod method = SpdyHeaders.getMethod(spdyVersion, requestFrame);
|
||||||
String url = SpdyHeaders.getUrl(spdyVersion, requestFrame);
|
String url = SpdyHeaders.getUrl(spdyVersion, requestFrame);
|
||||||
HttpVersion httpVersion = SpdyHeaders.getVersion(spdyVersion, requestFrame);
|
HttpVersion httpVersion = SpdyHeaders.getVersion(spdyVersion, requestFrame);
|
||||||
@ -334,12 +335,10 @@ public class SpdyHttpDecoder extends MessageToMessageDecoder<SpdyFrame> {
|
|||||||
// 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 = headers.get(SpdyHeaders.HttpNames.HOST);
|
||||||
SpdyHeaders.removeHost(requestFrame);
|
headers.remove(SpdyHeaders.HttpNames.HOST);
|
||||||
HttpHeaders.setHost(req, host);
|
req.headers().set(HttpHeaders.Names.HOST, host);
|
||||||
}
|
|
||||||
|
|
||||||
for (Map.Entry<String, String> e: requestFrame.headers()) {
|
for (Map.Entry<String, String> e: requestFrame.headers()) {
|
||||||
req.headers().add(e.getKey(), e.getValue());
|
req.headers().add(e.getKey(), e.getValue());
|
||||||
|
Loading…
Reference in New Issue
Block a user