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

Fix for Aws::S3::Client#head_bucket with improper region. #1162

Merged
merged 1 commit into from
Apr 18, 2016

Conversation

trevorrowe
Copy link
Member

Resolved the following issues:

s3 = Aws::S3::Client.new(region: 'us-west-1')
s3.head_bucket(bucket: 'us-west-2-bucket')
#=> raises Aws::S3::Errors::BadRequest (without a message)

If the bucket exists, but you are configured for the incorrect region, the SDK fails to extract the actual bucket region from the 400 response. This results in an empty error message. Added support for loading the bucket region from the "x-amz-bucket-region" header, which is necessary for all HEAD responses.

Fixes #1161

Resolved the following issues:

  s3 = Aws::S3::Client.new(region: 'us-west-1')
  s3.head_bucket(bucket: 'us-west-2-bucket')
  #=> raises Aws::S3::Errors::BadRequest (without a message)

If the bucket exists, but you are configured for the incorrect region,
the SDK fails to extract the actual bucket region from the 400 response.
This results in an empty error message. Added support for loading the
bucket region from the "x-amz-bucket-region" header, which is necessary
for all HEAD responses.

Fixes #1161
@awood45
Copy link
Member

awood45 commented Apr 18, 2016

LGTM

@awood45 awood45 merged commit be78fb3 into master Apr 18, 2016
trevorrowe added a commit that referenced this pull request Apr 19, 2016
@cjyclaire cjyclaire deleted the s3-head-bucket-fix branch May 5, 2017 20:28
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