From 404536cac0ed9ee368547695720ee61246b0c2f0 Mon Sep 17 00:00:00 2001 From: Andriy Redko Date: Fri, 4 Oct 2024 08:06:53 -0400 Subject: [PATCH] Address code review comments Signed-off-by: Andriy Redko --- .../src/main/java/reactor/netty/http/HttpDecoderSpec.java | 1 + .../test/java/reactor/netty/http/client/HttpClientTest.java | 2 +- .../test/java/reactor/netty/http/server/HttpServerTests.java | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/reactor-netty-http/src/main/java/reactor/netty/http/HttpDecoderSpec.java b/reactor-netty-http/src/main/java/reactor/netty/http/HttpDecoderSpec.java index 44a54565f..6ed2d7835 100644 --- a/reactor-netty-http/src/main/java/reactor/netty/http/HttpDecoderSpec.java +++ b/reactor-netty-http/src/main/java/reactor/netty/http/HttpDecoderSpec.java @@ -233,6 +233,7 @@ public int h2cMaxContentLength() { * * @param allowPartialChunks set to {@code false} to only allow sending whole chunks down the pipeline. * @return this option builder for further configuration + * @since 1.1.23 */ public T allowPartialChunks(boolean allowPartialChunks) { this.allowPartialChunks = allowPartialChunks; diff --git a/reactor-netty-http/src/test/java/reactor/netty/http/client/HttpClientTest.java b/reactor-netty-http/src/test/java/reactor/netty/http/client/HttpClientTest.java index 4e8748ee5..5fff508ab 100644 --- a/reactor-netty-http/src/test/java/reactor/netty/http/client/HttpClientTest.java +++ b/reactor-netty-http/src/test/java/reactor/netty/http/client/HttpClientTest.java @@ -1701,7 +1701,7 @@ void httpClientResponseConfigInjectAttributes() { AtomicBoolean validate = new AtomicBoolean(); AtomicInteger chunkSize = new AtomicInteger(); AtomicBoolean allowDuplicateContentLengths = new AtomicBoolean(); - AtomicBoolean allowPartialChunks = new AtomicBoolean(); + AtomicBoolean allowPartialChunks = new AtomicBoolean(true); disposableServer = createServer() .handle((req, resp) -> req.receive() diff --git a/reactor-netty-http/src/test/java/reactor/netty/http/server/HttpServerTests.java b/reactor-netty-http/src/test/java/reactor/netty/http/server/HttpServerTests.java index 27f3d98e6..a391896fc 100644 --- a/reactor-netty-http/src/test/java/reactor/netty/http/server/HttpServerTests.java +++ b/reactor-netty-http/src/test/java/reactor/netty/http/server/HttpServerTests.java @@ -975,7 +975,7 @@ void httpServerRequestConfigInjectAttributes() { AtomicBoolean validate = new AtomicBoolean(); AtomicInteger chunkSize = new AtomicInteger(); AtomicBoolean allowDuplicateContentLengths = new AtomicBoolean(); - AtomicBoolean allowPartialChunks = new AtomicBoolean(); + AtomicBoolean allowPartialChunks = new AtomicBoolean(true); disposableServer = createServer() .httpRequestDecoder(opt -> opt.maxInitialLineLength(123) @@ -995,6 +995,7 @@ void httpServerRequestConfigInjectAttributes() { chunkSize.set((Integer) getValueReflection(decoder, "maxChunkSize", 2)); validate.set((Boolean) getValueReflection(decoder, "validateHeaders", 2)); allowDuplicateContentLengths.set((Boolean) getValueReflection(decoder, "allowDuplicateContentLengths", 2)); + allowPartialChunks.set((Boolean) getValueReflection(decoder, "allowPartialChunks", 2)); }) .bindNow();