Repository navigation
rewrite: scope keyed query replace to its named key - #7818
Merged
Merged
Conversation
Member
|
Thanks, the change seems right to me. The keyed Two things:
You could also add one keyed |
Contributor
Author
|
CLA's green now. Added the disclosure to the PR body, and pushed a keyed |
steadytao
requested changes
Jun 14, 2026
steadytao
approved these changes
Jun 15, 2026
steadytao
left a comment
Member
There was a problem hiding this comment.
LGTM. Keyed query replace now only mutates the named query key while * keeps the existing all-keys behaviour and the tests cover keyed, wildcard, missing-key, and regexp cases.
This was referenced Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Repro: with
query replace a foo bar, request/?a=foo&b=foocomes out asa=bar&b=bar; expecteda=bar&b=foo.Cause: the non-
*branch of theReplaceloop inqueryOps.doranges over every key and never uses the computedkey, so it is an exact copy of thekey == "*"branch and rewrites unrelated parameters.Fix: scope the keyed branch to
query[key], matching theRename/Set/Addquery ops and the headers moduleReplace. Added a table test covering the keyed,*, missing-key, and keyedsearch_regexpcases.Assistance Disclosure
Used an LLM lightly to sanity-check the diff and the test cases; I wrote and verified the change myself.