Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/next-release/feature-AWSSDKforJavav2-b18ecdd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "feature",
"category": "Apache 5 HTTP Client",
"contributor": "",
"description": "Disable Expect 100-Continue by default in the Apache5 HTTP Client."
}
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,8 @@ public interface Builder extends SdkHttpClient.Builder<Apache5HttpClient.Builder
Builder localAddress(InetAddress localAddress);

/**
* Configure whether the client should send an HTTP expect-continue handshake before each request.
* Configure whether the client should send an HTTP expect-continue handshake before each request. By default
* this is disabled.
*/
Builder expectContinueEnabled(Boolean expectContinueEnabled);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
@SdkInternalApi
public final class DefaultConfiguration {
public static final Boolean EXPECT_CONTINUE_ENABLED = Boolean.TRUE;
public static final Boolean EXPECT_CONTINUE_ENABLED = Boolean.FALSE;

private DefaultConfiguration() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
* <p>
* <b>Note:</b> When using the Apache HTTP client, the Apache client also independently adds the
* <b>Note:</b> 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 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)}. 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)
Expand Down
Loading