Correctly add STREAM_WEIGHT header in InboundHttp2ToHttpAdapter.onPushPromiseRead(...)

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.
This commit is contained in:
Norman Maurer 2016-10-03 18:36:18 +02:00
parent e102a008b6
commit be8b6c6f24

View File

@ -303,6 +303,8 @@ public class InboundHttp2ToHttpAdapter extends Http2EventAdapter {
} }
msg.headers().setInt(HttpConversionUtil.ExtensionHeaderNames.STREAM_PROMISE_ID.text(), streamId); 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); processHeadersEnd(ctx, promisedStream, msg, false);
} }