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.
master
Anis Elleuch 8 years ago committed by Harshavardhana
parent 586058f079
commit e1f64141a2
  1. 3
      cmd/signature-v2.go

@ -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

Loading…
Cancel
Save