提交 ef91d2f2 编写于 作者: C chnliyong 提交者: Davies Liu

fix s3 auto find region (#72)

上级 d5195233
......@@ -245,8 +245,8 @@ func autoS3Region(bucketName, accessKey, secretKey string) (string, error) {
return *result.LocationConstraint, nil
}
if err1, ok := err.(awserr.Error); ok {
// InvalidAccessKeyId means the credentials is not for this region
if err1.Code() != "InvalidAccessKeyId" {
// continue to try other regions if the credentials are invalid, otherwise stop trying.
if errCode := err1.Code(); errCode != "InvalidAccessKeyId" && errCode != "InvalidToken" {
return "", err
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册