presign-v2: Compute signature on encoded URL path (#3612)

Encode the path of the passed presigned url before calculating the signature. This fixes
presigning objects whose names contain characters that are found encoded in urls.
This commit is contained in:
Anis Elleuch 2017-01-23 17:54:32 +01:00 committed by Harshavardhana
parent 586058f079
commit e1f64141a2

View File

@ -92,9 +92,10 @@ func doesPresignV2SignatureMatch(r *http.Request) APIErrorCode {
if encodedResource == "" {
splits := strings.Split(r.URL.Path, "?")
if len(splits) > 0 {
encodedResource = splits[0]
encodedResource = getURLEncodedName(splits[0])
}
}
queries := strings.Split(encodedQuery, "&")
var filteredQueries []string
var gotSignature string