mirror of
https://github.com/minio/minio.git
synced 2025-11-08 21:24:55 -05:00
signature-v4: Support for transfer-encoding request header (#4053)
This commit is contained in:
committed by
Harshavardhana
parent
f205689ff5
commit
af82d27018
@@ -107,7 +107,8 @@ func getURLEncodedName(name string) string {
|
||||
}
|
||||
|
||||
// extractSignedHeaders extract signed headers from Authorization header
|
||||
func extractSignedHeaders(signedHeaders []string, reqHeaders http.Header) (http.Header, APIErrorCode) {
|
||||
func extractSignedHeaders(signedHeaders []string, r *http.Request) (http.Header, APIErrorCode) {
|
||||
reqHeaders := r.Header
|
||||
// find whether "host" is part of list of signed headers.
|
||||
// if not return ErrUnsignedHeaders. "host" is mandatory.
|
||||
if !contains(signedHeaders, "host") {
|
||||
@@ -145,6 +146,10 @@ func extractSignedHeaders(signedHeaders []string, reqHeaders http.Header) (http.
|
||||
if header == "host" {
|
||||
continue
|
||||
}
|
||||
if header == "transfer-encoding" {
|
||||
extractedSignedHeaders[header] = r.TransferEncoding
|
||||
continue
|
||||
}
|
||||
// If not found continue, we will stop here.
|
||||
return nil, ErrUnsignedHeaders
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user