mirror of
https://github.com/minio/minio.git
synced 2024-12-25 22:55:54 -05:00
auth: Detect anonymous as the last resort.
This commit is contained in:
parent
e54aa10201
commit
166ef09c3d
@ -91,9 +91,6 @@ const (
|
|||||||
|
|
||||||
// Get request authentication type.
|
// Get request authentication type.
|
||||||
func getRequestAuthType(r *http.Request) authType {
|
func getRequestAuthType(r *http.Request) authType {
|
||||||
if _, ok := r.Header["Authorization"]; !ok {
|
|
||||||
return authTypeAnonymous
|
|
||||||
}
|
|
||||||
if isRequestSignatureV4(r) {
|
if isRequestSignatureV4(r) {
|
||||||
return authTypeSigned
|
return authTypeSigned
|
||||||
} else if isRequestPresignedSignatureV4(r) {
|
} else if isRequestPresignedSignatureV4(r) {
|
||||||
@ -102,6 +99,8 @@ func getRequestAuthType(r *http.Request) authType {
|
|||||||
return authTypeJWT
|
return authTypeJWT
|
||||||
} else if isRequestPostPolicySignatureV4(r) {
|
} else if isRequestPostPolicySignatureV4(r) {
|
||||||
return authTypePostPolicy
|
return authTypePostPolicy
|
||||||
|
} else if _, ok := r.Header["Authorization"]; !ok {
|
||||||
|
return authTypeAnonymous
|
||||||
}
|
}
|
||||||
return authTypeUnknown
|
return authTypeUnknown
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user