sigv2: Unespace canonicalized resources values (#4034)

Values of canonicalized query resources should be unescaped before calculating
the signature. This bug is not noticed before because partNumber and uploadID
values in Minio doesn't have characters that need to be escaped.
master
Anis Elleuch 8 years ago committed by Harshavardhana
parent 3fe33e7b15
commit 52d8f564bf
  1. 8
      cmd/signature-v2.go

@ -282,7 +282,13 @@ func canonicalizedResourceV2(encodedPath string, encodedQuery string) string {
canonicalQueries = append(canonicalQueries, key)
continue
}
canonicalQueries = append(canonicalQueries, key+"="+val)
// Resources values should be unescaped
unescapedVal, err := url.QueryUnescape(val)
if err != nil {
errorIf(err, "Unable to unescape query value (query = `%s`, value = `%s`)", key, val)
continue
}
canonicalQueries = append(canonicalQueries, key+"="+unescapedVal)
}
if len(canonicalQueries) == 0 {
return encodedPath

Loading…
Cancel
Save