Skip to content

preserve original query encoding in OrderedParams round-trip (#379)#747

Open
Mzack9999 wants to merge 1 commit into
mainfrom
379-orderedparams-preserve-raw
Open

preserve original query encoding in OrderedParams round-trip (#379)#747
Mzack9999 wants to merge 1 commit into
mainfrom
379-orderedparams-preserve-raw

Conversation

@Mzack9999
Copy link
Copy Markdown
Member

Fixes #379.

urlutil.OrderedParams now stores each parameter as a standalone entry that remembers the original encoded segment. Decode followed by Encode (with no mutations) produces a byte-for-byte identical query string, so parameters that came in without = stay without =, original escape choices (+ vs %20, %3D vs =) are preserved, and flipping IncludeEquals no longer mangles decoded entries - the flag only governs programmatically added/mutated parameters.

Entries touched via Add/Set/Update go through ParamEncode + IncludeEquals exactly as before; untouched siblings stay verbatim. Set and Update now replace in place at the first occurrence of the key (preserving insertion order) instead of moving the key to the end.

Validated against nuclei (pkg/fuzz/..., pkg/protocols/..., pkg/authprovider/...) and the full httpx test suite with a local replace - both build and pass.

@Mzack9999 Mzack9999 requested a review from dogancanbakir May 19, 2026 21:08
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.

Refactor OrderedParams to fix query param inconsistencies

1 participant