-
Notifications
You must be signed in to change notification settings - Fork 694
Description
When using the MinIO Go SDK to call AWS S3 service, it occasionally returns a 400 Bad Request
response.
Upon investigation, we found that if the region is not specified, the SDK calls GetBucketLocation
and relies on the AuthorizationHeaderMalformed
response to extract the correct region. However, AWS does not always include the region in the AuthorizationHeaderMalformed
response.
This causes external applications using the MinIO Go SDK to send requests to AWS S3 with the default us-east-1 region in the auth header. AWS rejects such requests, returning a 400 Bad Request error.
The AWS documentation states:
We recommend that you use HeadBucket to return the Region that a bucket resides in. For backward compatibility, Amazon S3 continues to support GetBucketLocation.
It seems that using HeadBucket
instead of GetBucketLocation
to fetch the bucket's region would be a more reliable approach.
Could the SDK be updated to prefer HeadBucket
for determining the bucket's region to avoid these issues?