出现错误——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 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南