mirror of
https://github.com/minio/minio.git
synced 2025-11-28 13:09:09 -05:00
signature: No need to validate region for getBucketLocation and listBuckets.
This type of check is added for making sure that we can support custom regions. ListBuckets and GetBucketLocation are always "us-east-1" rest should look for the configured region. Fixes #1278
This commit is contained in:
@@ -129,10 +129,11 @@ func isReqAuthenticated(r *http.Request) (s3Error APIErrorCode) {
|
||||
}
|
||||
// Populate back the payload.
|
||||
r.Body = ioutil.NopCloser(bytes.NewReader(payload))
|
||||
validateRegion := true // Validate region.
|
||||
if isRequestSignatureV4(r) {
|
||||
return doesSignatureMatch(hex.EncodeToString(sum256(payload)), r)
|
||||
return doesSignatureMatch(hex.EncodeToString(sum256(payload)), r, validateRegion)
|
||||
} else if isRequestPresignedSignatureV4(r) {
|
||||
return doesPresignedSignatureMatch(r)
|
||||
return doesPresignedSignatureMatch(r, validateRegion)
|
||||
}
|
||||
return ErrAccessDenied
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user