From c88dca984de97cf0b49687644c95b88e8c0bc7b3 Mon Sep 17 00:00:00 2001 From: "A. Elleuch" Date: Mon, 26 Jun 2017 02:39:14 +0100 Subject: [PATCH] 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. --- cmd/web-handlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/web-handlers.go b/cmd/web-handlers.go index 8c41b283c..bbde076f9 100644 --- a/cmd/web-handlers.go +++ b/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