Getting error - The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'ap-south-1' (Service: Amazon S3; Status Code: 400; Error Code: AuthorizationHeaderMalformed)

0

I'm trying to get region-wise buckets using getBucketLocation() method in AWS S3 SDK, for all the regions it returns proper outputs but for the region us-east-1 it throws the error.

Tried few solutions such as changing the bucket name, deleting the bucket etc. but still the error persists.

質問済み 1年前3211ビュー
2回答
0
承認された回答

getBucketLocation() returns a region ID like "af-south-1" for all regions except us-east-1, when it returns null. Are you sure it's getBucketLocation() returning the error rather than something using its output that's getting tripped up by the null?

エキスパート
回答済み 1年前
0

I debugged the code and as per you were saying getBucketLocation() returns "US" for us-east-1, so I was getting that error. Problem has been resolved. Thank you.

回答済み 1年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ