hrw: Supports indexed query parameters as conds#12822
Merged
zwoop merged 3 commits intoapache:masterfrom Jan 29, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for extracting individual query parameter values in the header_rewrite plugin using indexed query parameter syntax. The feature allows conditions to match against specific query parameter values using the syntax %{CLIENT-URL:QUERY:<param_name>} instead of matching against the entire query string.
Changes:
- Introduced query parameter caching mechanism to efficiently parse and retrieve individual query parameter values
- Extended URL qualifier syntax to support sub-keys for QUERY components (e.g.,
QUERY:version) - Added cache invalidation when URL query strings are modified via operators
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| plugins/header_rewrite/resources.h | Added query parameter caching infrastructure and get_query_param() method to Resources class |
| plugins/header_rewrite/resources.cc | Implemented query parameter parsing and caching logic using swoc::TextView |
| plugins/header_rewrite/conditions.h | Added _query_param member to store the specific parameter name for QUERY sub-key |
| plugins/header_rewrite/conditions.cc | Extended URL qualifier parsing to support sub-key syntax and modified query evaluation to use cached parameter values |
| plugins/header_rewrite/operators.cc | Added cache invalidation calls when query strings are modified by set-destination and rm-destination operators |
| doc/admin-guide/plugins/header_rewrite.en.rst | Documented the new QUERY sub-key syntax with usage examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
I addressed Co-Pilot's suggestions, most where very nit-picky, one was wrong. :) |
Contributor
Author
|
[approve ci osx] |
Contributor
Author
|
I think I've addressed the review issues. |
bneradt
approved these changes
Jan 28, 2026
Contributor
Author
|
[approve ci debian] |
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.
Co-author / ideas: Miles