Skip to content

fix: missing url encode multipart object keys#17

Open
Nana-EC wants to merge 3 commits into
mainfrom
13-url-encode-multipart-object-keys
Open

fix: missing url encode multipart object keys#17
Nana-EC wants to merge 3 commits into
mainfrom
13-url-encode-multipart-object-keys

Conversation

@Nana-EC
Copy link
Copy Markdown
Contributor

@Nana-EC Nana-EC commented Mar 14, 2026

Description:
createMultipartUpload(), multipartUploadPart(), completeMultipartUpload(), and abortMultipartUpload() were concatenating the raw object key into the request URL without encoding. Keys containing spaces, +, #, or other reserved characters produced malformed URLs and incorrect SigV4 signatures, causing request failures.

  • Apply urlEncode(key, true) consistently across all four methods, matching the existing behaviour of uploadTextFile() and downloadTextFile().
  • Add regression test uploadFile() with a key containing spaces and + completes successfully
    and the object is retrievable under the correct key via MinIO.
  • Add regression test abortMultipartUpload() with a special-character key removes the upload
    ID from listMultipartUploads() as expected.

Before the fix both tests would produce malformed URLs and fail with
authentication or network errors.

Related issue(s):

Fixes #13

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@Nana-EC Nana-EC added this to the 0.1 milestone Mar 14, 2026
@Nana-EC Nana-EC self-assigned this Mar 14, 2026
@Nana-EC Nana-EC changed the title 13 url encode multipart object keys fix: missing url encode multipart object keys Mar 14, 2026
Nana-EC added 3 commits March 13, 2026 23:22
createMultipartUpload(), multipartUploadPart(), completeMultipartUpload(),
and abortMultipartUpload() were concatenating the raw object key into the
request URL without encoding. Keys containing spaces, +, #, or other
reserved characters produced malformed URLs and incorrect SigV4
signatures, causing request failures.

Apply urlEncode(key, true) consistently across all four methods, matching
the existing behaviour of uploadTextFile() and downloadTextFile().

Signed-off-by: Nana Essilfie-Conduah <nana@swirldslabs.com>
#13)

Two regression tests:
- uploadFile() with a key containing spaces and + completes successfully
  and the object is retrievable under the correct key via MinIO.
- abortMultipartUpload() with a special-character key removes the upload
  ID from listMultipartUploads() as expected.

Before the fix both tests would produce malformed URLs and fail with
authentication or network errors.

Signed-off-by: Nana Essilfie-Conduah <nana@swirldslabs.com>
Signed-off-by: Nana Essilfie-Conduah <nana@swirldslabs.com>
@Nana-EC Nana-EC force-pushed the 13-url-encode-multipart-object-keys branch from 102d358 to 2f8b481 Compare March 14, 2026 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Object keys are not URL-encoded in multipart upload methods

1 participant