From be8b6c6f24e21eb8704720200b84a4a9c8b0ce9f Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Mon, 3 Oct 2016 18:36:18 +0200 Subject: [PATCH] Correctly add STREAM_WEIGHT header in InboundHttp2ToHttpAdapter.onPushPromiseRead(...) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Motivation: The weight header with the default value is not set but it should be (rfc7540#5.3.5: …Pushed streams initially depend on their associated stream … are assigned a default weight of 16). Modifications: Add STREAM_WEIGHT header. Result: Correctly add headers. --- .../io/netty/handler/codec/http2/InboundHttp2ToHttpAdapter.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/InboundHttp2ToHttpAdapter.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/InboundHttp2ToHttpAdapter.java index 4e2d6f5a27..620c5d6fde 100644 --- a/codec-http2/src/main/java/io/netty/handler/codec/http2/InboundHttp2ToHttpAdapter.java +++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/InboundHttp2ToHttpAdapter.java @@ -303,6 +303,8 @@ public class InboundHttp2ToHttpAdapter extends Http2EventAdapter { } msg.headers().setInt(HttpConversionUtil.ExtensionHeaderNames.STREAM_PROMISE_ID.text(), streamId); + msg.headers().setShort(HttpConversionUtil.ExtensionHeaderNames.STREAM_WEIGHT.text(), + Http2CodecUtil.DEFAULT_PRIORITY_WEIGHT); processHeadersEnd(ctx, promisedStream, msg, false); }