Skip to content

Preserve escaped paths and empty queries in @request-target - #43

Open
jeremy-cxf wants to merge 2 commits into
yaronf:mainfrom
jeremy-cxf:jcocks/preserve-escaped-paths
Open

jeremy-cxf wants to merge 2 commits into
yaronf:mainfrom
jeremy-cxf:jcocks/preserve-escaped-paths

Conversation

@jeremy-cxf

Copy link
Copy Markdown

https://www.rfc-editor.org/rfc/rfc9421.html#section-2.2.5 states:

For HTTP/1.1, the component value is equivalent to the request target portion of the request line.

The next paragraph also states:

The origin form value is a combination of the absolute path and query components of the request URL.

This fixes signature mismatches caused by decoding escaped paths (e.g /a%2Fb becoming /a/b) or dropping an empty query delimiter (e.g /path? becoming /path).

This PR just adds URL.EscapedPath() and respects URL.ForceQuery preserving those bytes in the signature base.

This branch has not been deployed

No deployments
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