Skip to content

HeadBucket does not return Bucket Region header #6607

@kouta-kun

Description

@kouta-kun

Describe the issue

The AWS-SDK documentation recommends using HeadBucket instead of GetBucketLocation for determining Bucket region:

We recommend that you use [HeadBucket ](https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html)
to return the Region that a bucket resides in. For backward compatibility, Amazon S3 continues to support GetBucketLocation.

However, the header that contains this piece of information is not contained in the $metadata attribute of the HeadBucketCommandOutput object. According to Generic documentation, this information is returned in the x-amz-bucket-region header, which does not seem to be part of the RequestMetadata (does not show in a debugger either).

Links

https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html
https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3/command/GetBucketLocationCommand/

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.p2This is a standard priority issues3service-apiThis issue is due to a problem in a service API, not the SDK implementation.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions