|
23 | 23 | import io.netty.handler.codec.ByteToMessageDecoder; |
24 | 24 | import io.netty.handler.codec.http.HttpContentCompressor; |
25 | 25 | import io.netty.handler.codec.http.HttpContentDecompressor; |
26 | | -import io.netty.handler.codec.http.HttpDecoderConfig; |
27 | 26 | import io.netty.handler.codec.http.HttpMessage; |
28 | 27 | import io.netty.handler.codec.http.HttpRequestDecoder; |
29 | 28 | import io.netty.handler.codec.http.HttpResponse; |
@@ -343,19 +342,23 @@ protected void initChannel(Channel ch) throws Exception { |
343 | 342 | ch.pipeline().addLast("read_timeout", new ReadTimeoutHandler(transport.readTimeoutMillis, TimeUnit.MILLISECONDS)); |
344 | 343 | } |
345 | 344 | final HttpRequestDecoder decoder; |
346 | | - final HttpDecoderConfig decoderConfig = new HttpDecoderConfig().setMaxInitialLineLength(handlingSettings.maxInitialLineLength()) |
347 | | - .setMaxHeaderSize(handlingSettings.maxHeaderSize()) |
348 | | - .setMaxChunkSize(handlingSettings.maxChunkSize()) |
349 | | - .setStrictLineParsing(false); |
350 | 345 | if (httpValidator != null) { |
351 | | - decoder = new HttpRequestDecoder(decoderConfig) { |
| 346 | + decoder = new HttpRequestDecoder( |
| 347 | + handlingSettings.maxInitialLineLength(), |
| 348 | + handlingSettings.maxHeaderSize(), |
| 349 | + handlingSettings.maxChunkSize() |
| 350 | + ) { |
352 | 351 | @Override |
353 | 352 | protected HttpMessage createMessage(String[] initialLine) throws Exception { |
354 | 353 | return HttpHeadersAuthenticatorUtils.wrapAsMessageWithAuthenticationContext(super.createMessage(initialLine)); |
355 | 354 | } |
356 | 355 | }; |
357 | 356 | } else { |
358 | | - decoder = new HttpRequestDecoder(decoderConfig); |
| 357 | + decoder = new HttpRequestDecoder( |
| 358 | + handlingSettings.maxInitialLineLength(), |
| 359 | + handlingSettings.maxHeaderSize(), |
| 360 | + handlingSettings.maxChunkSize() |
| 361 | + ); |
359 | 362 | } |
360 | 363 | decoder.setCumulator(ByteToMessageDecoder.COMPOSITE_CUMULATOR); |
361 | 364 | ch.pipeline().addLast("decoder", decoder); // parses the HTTP bytes request into HTTP message pieces |
|
0 commit comments