mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
Return authHeaderMalformed for an incorrect region in signature (#5618)
This commit is contained in:
committed by
kannappanr
parent
7aaf01eb74
commit
d90985b6d8
@@ -70,9 +70,6 @@ func calculateSeedSignature(r *http.Request) (signature string, region string, d
|
||||
// Access credentials.
|
||||
cred := globalServerConfig.GetCredential()
|
||||
|
||||
// Configured region.
|
||||
confRegion := globalServerConfig.GetRegion()
|
||||
|
||||
// Copy request.
|
||||
req := *r
|
||||
|
||||
@@ -80,7 +77,7 @@ func calculateSeedSignature(r *http.Request) (signature string, region string, d
|
||||
v4Auth := req.Header.Get("Authorization")
|
||||
|
||||
// Parse signature version '4' header.
|
||||
signV4Values, errCode := parseSignV4(v4Auth)
|
||||
signV4Values, errCode := parseSignV4(v4Auth, globalServerConfig.GetRegion())
|
||||
if errCode != ErrNone {
|
||||
return "", "", time.Time{}, errCode
|
||||
}
|
||||
@@ -105,11 +102,6 @@ func calculateSeedSignature(r *http.Request) (signature string, region string, d
|
||||
|
||||
// Verify if region is valid.
|
||||
region = signV4Values.Credential.scope.region
|
||||
// Should validate region, only if region is set. Some operations
|
||||
// do not need region validated for example GetBucketLocation.
|
||||
if !isValidRegion(region, confRegion) {
|
||||
return "", "", time.Time{}, ErrInvalidRegion
|
||||
}
|
||||
|
||||
// Extract date, if not present throw error.
|
||||
var dateStr string
|
||||
|
||||
Reference in New Issue
Block a user