From ccf434dd35f09d1e9e4011903979fbe8c01a263b Mon Sep 17 00:00:00 2001 From: Maxim Nesen Date: Thu, 5 Oct 2023 18:14:52 +0200 Subject: [PATCH] Expect:100-continue fixes for Netty Signed-off-by: Maxim Nesen --- .../connector/Expect100ContinueConnectorExtension.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/Expect100ContinueConnectorExtension.java b/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/Expect100ContinueConnectorExtension.java index 0cc3d30eda..0c8bb4bb40 100644 --- a/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/Expect100ContinueConnectorExtension.java +++ b/connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/Expect100ContinueConnectorExtension.java @@ -47,10 +47,10 @@ public void invoke(ClientRequest request, HttpRequest extensionParam) { final boolean allowStreaming = length > expectContinueSizeThreshold || entityProcessing == RequestEntityProcessing.CHUNKED; - if (extensionParam.protocolVersion().equals(HttpVersion.HTTP_1_1) - && (!Boolean.TRUE.equals(expectContinueActivated) + if (!extensionParam.protocolVersion().equals(HttpVersion.HTTP_1_1) + || !Boolean.TRUE.equals(expectContinueActivated) || !request.hasEntity() - || !allowStreaming)) { + || !allowStreaming) { return; } extensionParam.headers().add(HttpHeaderNames.EXPECT, HttpHeaderValues.CONTINUE);