Correctly take Http2FrameCodecBuilder.isValidateHeaders() into account when creating a Http2FrameCodec from an existing Http2FrameWriter. (#9600)

Motivation:

We did miss to take Http2FrameCodecBuilder.isValidateHeaders() into account when a Http2FrameWriter was set on the builder and always assumed validation should be enabled.

Modifications:

Remove hardcode value and use configured value

Result:

Http2FrameCodecBuilder.isValidateHeaders() is respected in all cases
This commit is contained in:
Norman Maurer 2019-09-26 21:57:05 +02:00
parent 5d1414a8a9
commit 6f584ec9de
2 changed files with 4 additions and 4 deletions

View File

@ -189,8 +189,8 @@ public class Http2FrameCodecBuilder extends
DefaultHttp2Connection connection = new DefaultHttp2Connection(isServer(), maxReservedStreams());
Long maxHeaderListSize = initialSettings().maxHeaderListSize();
Http2FrameReader frameReader = new DefaultHttp2FrameReader(maxHeaderListSize == null ?
new DefaultHttp2HeadersDecoder(true) :
new DefaultHttp2HeadersDecoder(true, maxHeaderListSize));
new DefaultHttp2HeadersDecoder(isValidateHeaders()) :
new DefaultHttp2HeadersDecoder(isValidateHeaders(), maxHeaderListSize));
if (frameLogger() != null) {
frameWriter = new Http2OutboundFrameLogger(frameWriter, frameLogger());

View File

@ -215,8 +215,8 @@ public class Http2MultiplexCodecBuilder
DefaultHttp2Connection connection = new DefaultHttp2Connection(isServer(), maxReservedStreams());
Long maxHeaderListSize = initialSettings().maxHeaderListSize();
Http2FrameReader frameReader = new DefaultHttp2FrameReader(maxHeaderListSize == null ?
new DefaultHttp2HeadersDecoder(true) :
new DefaultHttp2HeadersDecoder(true, maxHeaderListSize));
new DefaultHttp2HeadersDecoder(isValidateHeaders()) :
new DefaultHttp2HeadersDecoder(isValidateHeaders(), maxHeaderListSize));
if (frameLogger() != null) {
frameWriter = new Http2OutboundFrameLogger(frameWriter, frameLogger());