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.

질문됨 일 년 전3221회 조회
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?

전문가
답변함 일 년 전
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.

답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠