Skip to content

Fix to handle temporary Redirect 307 for S3 Cross Region client #4197

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

Merged
merged 3 commits into from
Jul 19, 2023

Conversation

joviegas
Copy link
Contributor

@joviegas joviegas commented Jul 18, 2023

Motivation and Context

  • S3Cross region client with default region created in us-east-1 could not do cross region access

Modifications

  • Allow redirect access on Temporary Redirect 307 status code.

Testing

  • Added Integ and Junit test case

License

  • I confirm that this pull request can be released under the Apache 2 license

@joviegas joviegas requested a review from a team as a code owner July 18, 2023 02:22

public class S3CrossRegionCrtIntegrationTest extends S3CrossRegionAsyncIntegrationTestBase {
private static final String BUCKET = temporaryBucketName(S3CrossRegionCrtIntegrationTest.class);

@BeforeAll
static void setUpClass() {
s3 = s3ClientBuilder().build();
s3 = s3ClientBuilder().region(Region.AP_SOUTH_1).httpClient(ApacheHttpClient.create()).build();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: why do we need to set ApacheHttpClient explicitly? If we have to, can we use httpClientBuilder(ApacheHttpClient.builder()) so that the http client can be closed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added by mistake just for testing , removed it now

@@ -0,0 +1,6 @@
{
"type": "bugfix",
"category": "AWS SDK for Java v2",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: category should be S3

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@joviegas joviegas enabled auto-merge (squash) July 19, 2023 18:00
@joviegas joviegas disabled auto-merge July 19, 2023 18:45
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@joviegas joviegas merged commit 4fae33d into master Jul 19, 2023
@joviegas joviegas deleted the joviegas/bugfix_temp_redirect branch August 30, 2023 22:58
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