出现错误——The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'ap-south-1' (服务名:Amazon S3; 状态码:400; 错误码:AuthorizationHeaderMalformed)。

0

【以下的问题经过翻译处理】 我正在尝试使用AWS S3 SDK中的getBucketLocation()方法获取某个区域的存储桶,在所有区域中,它都能正常返回输出,但除了在us-east-1区域,它会抛出错误。尝试了一些解决方案,如更改存储桶名称,删除存储桶等,但错误仍然存在。

profile picture
전문가
질문됨 5달 전158회 조회
1개 답변
0

【以下的回答经过翻译处理】 Are you sure it's getBucketLocation() returning the error rather than something using its output that's getting tripped up by the null? 对于除us-east-1之外的所有区域,getBucketLocation() 都会返回类似于“af-south-1”的区域ID。而对于us-east-1,它会返回null。这种情况可能是由于您使用getBucketLocation()的输出时遇到了空值。

profile picture
전문가
답변함 5달 전

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

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

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

관련 콘텐츠