From e1f64141a275329be787766eea72c711aaa2a504 Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Mon, 23 Jan 2017 17:54:32 +0100 Subject: [PATCH] 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. --- cmd/signature-v2.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/signature-v2.go b/cmd/signature-v2.go index 2698891d3..c5540201e 100644 --- a/cmd/signature-v2.go +++ b/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