Fix expect 100 continue header handling

Due to a misordering of the HTTP handlers, the Netty 4 HTTP server
mishandles Expect: 100-continue headers from clients. This commit fixes
this issue by ordering the handlers correctly.

Relates #19904
This commit is contained in:
Jason Tedor 2016-08-10 07:21:22 -04:00 committed by GitHub
parent 4ed7c2bd35
commit f025c83a17
1 changed files with 1 additions and 1 deletions

View File

@ -548,12 +548,12 @@ public class Netty4HttpServerTransport extends AbstractLifecycleComponent implem
decoder.setCumulator(ByteToMessageDecoder.COMPOSITE_CUMULATOR);
ch.pipeline().addLast("decoder", decoder);
ch.pipeline().addLast("decoder_compress", new HttpContentDecompressor());
ch.pipeline().addLast("encoder", new HttpResponseEncoder());
final HttpObjectAggregator aggregator = new HttpObjectAggregator(Math.toIntExact(transport.maxContentLength.bytes()));
if (transport.maxCompositeBufferComponents != -1) {
aggregator.setMaxCumulationBufferComponents(transport.maxCompositeBufferComponents);
}
ch.pipeline().addLast("aggregator", aggregator);
ch.pipeline().addLast("encoder", new HttpResponseEncoder());
if (transport.compression) {
ch.pipeline().addLast("encoder_compress", new HttpContentCompressor(transport.compressionLevel));
}