出现错误——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
EXPERTE
gefragt vor 5 Monaten158 Aufrufe
1 Antwort
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
EXPERTE
beantwortet vor 5 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen