Skip to content

Commit 2c90282

Browse files
vadmestekannappanr
authored andcommitted
Do not encode ~ in V4 S3 signing (#798)
1 parent 49dc236 commit 2c90282

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

minio/signer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,9 @@ def generate_canonical_request(method, parsed_url, headers, signed_headers, cont
251251
:param headers: HTTP header dictionary.
252252
:param content_sha256: Content sha256 hexdigest string.
253253
"""
254-
lines = [method, parsed_url.path, parsed_url.query]
254+
# Should not encode ~. Decode it back if present.
255+
parsed_url_path = parsed_url.path.replace("%7E", "~")
256+
lines = [method, parsed_url_path, parsed_url.query]
255257

256258
# Headers added to canonical request.
257259
header_lines = []

0 commit comments

Comments
 (0)