Skip to content

Encode spaces as %20 in presigned query strings - #85

Open
brennanbutler01 wants to merge 1 commit into
mhart:masterfrom
brennanbutler01:fix/presigned-query-spaces
Open

brennanbutler01 wants to merge 1 commit into
mhart:masterfrom
brennanbutler01:fix/presigned-query-spaces

Conversation

@brennanbutler01

Copy link
Copy Markdown

Query signing calculates a canonical query with %20, but URLSearchParams serializes spaces as + in the returned URL. Normalize spaces after adding the signature and any appended session token, preserving literal plus signs, decoded values, and the existing signature.

Closes #83.

Adds browser coverage for spaces, literal plus signs, encoded-space strings, Unicode, empty values, pre-encoded input, and both session-token modes. Includes the four regenerated JavaScript distributions, following existing upstream changes. Unrelated declaration-output differences from the installed TypeScript version are excluded.

Validation on Node 24 and local Chrome:

  • Eight browser assertions fail before the fix; the complete browser signing suite passes afterward.
  • npm run lint, npm run build, and npm run test-node pass.
  • Both built module formats produce the corrected URL with the same signature as published 1.0.20.

Hosted storage services were not contacted, and npm run integration was not run. The provider rejection in #83 is the reporter's evidence; this change verifies encoding and signature preservation locally.

Prepared with OpenAI Codex assistance.

Normalize form-encoded spaces after adding signature and session-token
parameters. Preserve literal plus signs and signature inputs. Add browser
regressions and regenerate the tracked JavaScript distributions.

Prepared with OpenAI Codex assistance.
Copilot AI lite review requested due to automatic review settings September 18, 2026 08:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

signQuery returns non-canonical + encoding for spaces in query parameter values

3 participants