出现错误——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 个月前145 查看次数
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 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则