Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x] AwsSdk2Transport throw exception when using ApacheHttpClient to make an unsupported DELETE/GET request with a body #1288

Merged

Conversation

Xtansia
Copy link
Collaborator

@Xtansia Xtansia commented Nov 12, 2024

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

…an unsupported DELETE/GET request with a body (opensearch-project#1256)

* AwsSdk2Transport throw exception when using ApacheHttpClient to make an unsupported DELETE/GET request with a body

The AWS SDK's ApacheHttpClient implementation does not send the request body on DELETE or GET requests, https://github.com/aws/aws-sdk-java-v2/blob/master/http-clients/apache-client/src/main/java/software/amazon/awssdk/http/apache/internal/impl/ApacheHttpRequestFactory.java#L118-L137.

Additionally moves to the supported `AwsV4HttpSigner` as `Aws4Signer` is now deprecated: https://github.com/aws/aws-sdk-java-v2/blob/88abec27e7d5d35b21545c7e05875a7cc3d0f46e/core/auth/src/main/java/software/amazon/awssdk/auth/signer/Aws4Signer.java

Signed-off-by: Thomas Farr <tsfarr@amazon.com>

* Add guide note

Signed-off-by: Thomas Farr <tsfarr@amazon.com>

* Fix javadoc

Signed-off-by: Thomas Farr <tsfarr@amazon.com>

* Re-use ContentStreamProvider

Signed-off-by: Thomas Farr <tsfarr@amazon.com>

* Also validate URLConnection client

Signed-off-by: Thomas Farr <tsfarr@amazon.com>

* spotless

Signed-off-by: Thomas Farr <tsfarr@amazon.com>

* Test HEAD and OPTIONS

Signed-off-by: Thomas Farr <tsfarr@amazon.com>

---------

Signed-off-by: Thomas Farr <tsfarr@amazon.com>
(cherry picked from commit e8e3a99)
@Xtansia Xtansia merged commit 5983aea into opensearch-project:2.x Nov 12, 2024
47 of 56 checks passed
@Xtansia Xtansia deleted the backport/backport-1256-to-2.x branch November 12, 2024 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants