Skip to content

Commit

Permalink
fix URL decoding of x-amz-copy-source
Browse files Browse the repository at this point in the history
  • Loading branch information
bentsku committed Oct 22, 2023
1 parent 988cff8 commit a4f8700
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions moto/s3/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -1482,9 +1482,9 @@ def _key_response_put(
if isinstance(copy_source, bytes):
copy_source = copy_source.decode("utf-8")
copy_source_parsed = urlparse(copy_source)
url_path = copy_source_parsed.path
# this path should not be decoded, as it is not encoded in the headers
src_bucket, src_key = url_path.lstrip("/").split("/", 1)
src_bucket, src_key = (
unquote(copy_source_parsed.path).lstrip("/").split("/", 1)
)
src_version_id = parse_qs(copy_source_parsed.query).get(
"versionId", [None] # type: ignore
)[0]
Expand Down

0 comments on commit a4f8700

Please sign in to comment.