mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
Virtual host style S3 requests (#5095)
This commit is contained in:
committed by
Dee Koder
parent
d57d57ddf5
commit
e7a724de0d
@@ -157,6 +157,11 @@ func doesPresignV2SignatureMatch(r *http.Request) APIErrorCode {
|
||||
return ErrExpiredPresignRequest
|
||||
}
|
||||
|
||||
encodedResource, err = getResource(encodedResource, r.Host, globalDomainName)
|
||||
if err != nil {
|
||||
return ErrInvalidRequest
|
||||
}
|
||||
|
||||
expectedSignature := preSignatureV2(r.Method, encodedResource, strings.Join(filteredQueries, "&"), r.Header, expires)
|
||||
if gotSignature != expectedSignature {
|
||||
return ErrSignatureDoesNotMatch
|
||||
@@ -237,6 +242,11 @@ func doesSignV2Match(r *http.Request) APIErrorCode {
|
||||
return ErrInvalidQueryParams
|
||||
}
|
||||
|
||||
encodedResource, err = getResource(encodedResource, r.Host, globalDomainName)
|
||||
if err != nil {
|
||||
return ErrInvalidRequest
|
||||
}
|
||||
|
||||
expectedAuth := signatureV2(r.Method, encodedResource, strings.Join(unescapedQueries, "&"), r.Header)
|
||||
if v2Auth != expectedAuth {
|
||||
return ErrSignatureDoesNotMatch
|
||||
|
||||
Reference in New Issue
Block a user