web: Encode path in presigned GET urls (#4596)

When the browser asks for a GET presigned url, this latter is not
encoded and can be confusing when the user copies-pastes it somewhere,
especially when the path contains a space.
master
A. Elleuch 8 years ago committed by Harshavardhana
parent 1054f9cbf0
commit c88dca984d
  1. 2
      cmd/web-handlers.go

@ -919,7 +919,7 @@ func presignedGet(host, bucket, object string, expiry int64) string {
signature := getSignature(signingKey, stringToSign)
// Construct the final presigned URL.
return host + path + "?" + query + "&" + "X-Amz-Signature=" + signature
return host + getURLEncodedName(path) + "?" + query + "&" + "X-Amz-Signature=" + signature
}
// toJSONError converts regular errors into more user friendly

Loading…
Cancel
Save