From a2977aefcec6cc956f0ae708ed31dccf56dd4c60 Mon Sep 17 00:00:00 2001 From: Alex Woods Date: Mon, 30 Mar 2026 07:58:39 -0700 Subject: [PATCH 1/3] Disable Expect 100-Continue by default in Apache 5 HTTP client --- .changes/next-release/feature-AWSSDKforJavav2-b18ecdd.json | 6 ++++++ .../amazon/awssdk/http/apache5/Apache5HttpClient.java | 3 ++- .../awssdk/http/apache5/internal/DefaultConfiguration.java | 2 +- .../software/amazon/awssdk/services/s3/S3Configuration.java | 6 +++--- 4 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 .changes/next-release/feature-AWSSDKforJavav2-b18ecdd.json diff --git a/.changes/next-release/feature-AWSSDKforJavav2-b18ecdd.json b/.changes/next-release/feature-AWSSDKforJavav2-b18ecdd.json new file mode 100644 index 000000000000..7bbb9ed58f11 --- /dev/null +++ b/.changes/next-release/feature-AWSSDKforJavav2-b18ecdd.json @@ -0,0 +1,6 @@ +{ + "type": "feature", + "category": "AWS SDK for Java v2", + "contributor": "", + "description": "Disable Expect 100-Continue by default in the Apache5 HTTP Client." +} diff --git a/http-clients/apache5-client/src/main/java/software/amazon/awssdk/http/apache5/Apache5HttpClient.java b/http-clients/apache5-client/src/main/java/software/amazon/awssdk/http/apache5/Apache5HttpClient.java index ec75cf1ed785..92bd61fe117f 100644 --- a/http-clients/apache5-client/src/main/java/software/amazon/awssdk/http/apache5/Apache5HttpClient.java +++ b/http-clients/apache5-client/src/main/java/software/amazon/awssdk/http/apache5/Apache5HttpClient.java @@ -445,7 +445,8 @@ public interface Builder extends SdkHttpClient.Builder - * Note: When using the Apache HTTP client, the Apache client also independently adds the + * Note: When using the Apache4 HTTP client, the Apache4 client also independently adds the * {@code Expect: 100-continue} header by default via its own {@code expectContinueEnabled} setting. To fully - * suppress the header on the wire, you must also disable it on the Apache HTTP client builder using - * {@code ApacheHttpClient.builder().expectContinueEnabled(false)}. + * suppress the header on the wire, you must also disable it on the Apache4 HTTP client builder using + * {@code ApacheHttpClient.builder().expectContinueEnabled(false)}. The Apache5 HTTP client defaults * * @return True if the Expect: 100-continue header is enabled. * @see S3Configuration.Builder#expectContinueEnabled(Boolean) From 37ffbad48aeb192f5378c3d181dc27a347395a0e Mon Sep 17 00:00:00 2001 From: Alex Woods Date: Mon, 30 Mar 2026 10:46:35 -0700 Subject: [PATCH 2/3] Fix docs --- .../software/amazon/awssdk/services/s3/S3Configuration.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/s3/src/main/java/software/amazon/awssdk/services/s3/S3Configuration.java b/services/s3/src/main/java/software/amazon/awssdk/services/s3/S3Configuration.java index f72840ab6af6..c5d9a863e216 100644 --- a/services/s3/src/main/java/software/amazon/awssdk/services/s3/S3Configuration.java +++ b/services/s3/src/main/java/software/amazon/awssdk/services/s3/S3Configuration.java @@ -234,10 +234,11 @@ public boolean chunkedEncodingEnabled() { * By default, the SDK sends the {@code Expect: 100-continue} header for these operations, allowing the server to * reject the request before the client sends the full payload. Setting this to {@code false} disables this behavior. *

- * Note: When using the Apache4 HTTP client, the Apache4 client also independently adds the + * Note: When using the {@code ApacheHttpClient} (Apache 4), the Apache 4 client also independently adds the * {@code Expect: 100-continue} header by default via its own {@code expectContinueEnabled} setting. To fully * suppress the header on the wire, you must also disable it on the Apache4 HTTP client builder using - * {@code ApacheHttpClient.builder().expectContinueEnabled(false)}. The Apache5 HTTP client defaults + * {@code ApacheHttpClient.builder().expectContinueEnabled(false)}. This does NOT apply to the {@code Apache5HttpClient} + * which defaults {@code expectContinueEnabled} to false. * * @return True if the Expect: 100-continue header is enabled. * @see S3Configuration.Builder#expectContinueEnabled(Boolean) From 0c355420d46b476ebdf5f4a08eacf1a4168ab9d3 Mon Sep 17 00:00:00 2001 From: Alex Woods Date: Tue, 31 Mar 2026 08:12:24 -0700 Subject: [PATCH 3/3] Update changelog catagory --- .changes/next-release/feature-AWSSDKforJavav2-b18ecdd.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changes/next-release/feature-AWSSDKforJavav2-b18ecdd.json b/.changes/next-release/feature-AWSSDKforJavav2-b18ecdd.json index 7bbb9ed58f11..d73d207637e3 100644 --- a/.changes/next-release/feature-AWSSDKforJavav2-b18ecdd.json +++ b/.changes/next-release/feature-AWSSDKforJavav2-b18ecdd.json @@ -1,6 +1,6 @@ { "type": "feature", - "category": "AWS SDK for Java v2", + "category": "Apache 5 HTTP Client", "contributor": "", "description": "Disable Expect 100-Continue by default in the Apache5 HTTP Client." }