Skip to content

fix: missing url encode listobjects prefix#18

Open
Nana-EC wants to merge 3 commits into
mainfrom
14-url-encode-listobjects-prefix
Open

fix: missing url encode listobjects prefix#18
Nana-EC wants to merge 3 commits into
mainfrom
14-url-encode-listobjects-prefix

Conversation

@Nana-EC
Copy link
Copy Markdown
Contributor

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

Description:
The prefix was concatenated raw into the canonical query string.
A prefix containing &, =, +, spaces, or other reserved characters would corrupt the query string structure and produce an incorrect SigV4 canonical query string, causing authentication failures.

  • Apply urlEncode(prefix, false) so the value is safely percent-encoded before being embedded in the query string.
  • Regression test: upload objects under a key prefix that contains a space, then call listObjects() with that prefix. Before the fix, the unencoded space in the URL caused URISyntaxException (wrapped as UncheckedIOException); after the fix the correct objects are returned and unrelated keys are excluded.

Related issue(s):

Fixes #14

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 added 3 commits March 13, 2026 23:23
The prefix was concatenated raw into the canonical query string. A
prefix containing &, =, +, spaces, or other reserved characters would
corrupt the query string structure and produce an incorrect SigV4
canonical query string, causing authentication failures.

Apply urlEncode(prefix, false) so the value is safely percent-encoded
before being embedded in the query string.

Signed-off-by: Nana Essilfie-Conduah <nana@swirldslabs.com>
Regression test: upload objects under a key prefix that contains a
space, then call listObjects() with that prefix. Before the fix, the
unencoded space in the URL caused URISyntaxException (wrapped as
UncheckedIOException); after the fix the correct objects are returned
and unrelated keys are excluded.

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 14-url-encode-listobjects-prefix branch from 031fd41 to 6980b13 Compare March 14, 2026 03:23
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.

listObjects does not URL-encode the prefix query parameter

1 participant