Skip to content

Use raw path when building request signature#229

Merged
fredrbus merged 1 commit into
mainfrom
fix-signature-encoded-path
Jul 22, 2026
Merged

Use raw path when building request signature#229
fredrbus merged 1 commit into
mainfrom
fix-signature-encoded-path

Conversation

@fredrbus

Copy link
Copy Markdown
Contributor

Referencing issue #220

The signature is computed over the URL path, but getPath() read the decoded path from URI#getPath() rather than the encoded form actually transmitted. Any path with percent-encoded characters therefore produced a signature the server could not reproduce, and the request was refused.

Read the path via URI#getRawPath() so client and server canonicalize the same bytes. Tests cover an encoded path and a plain-ASCII path.

The signature is computed over the URL path, but getPath() read the
decoded path from URI#getPath() rather than the encoded form actually
transmitted. Any path with percent-encoded characters therefore produced
a signature the server could not reproduce, and the request was refused.

Read the path via URI#getRawPath() so client and server canonicalize the
same bytes. Tests cover an encoded path and a plain-ASCII path.
@fredrbus
fredrbus requested review from a team and runeflobakk July 22, 2026 10:38

@runeflobakk runeflobakk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Excellent! 💯

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.

2 participants