-
Notifications
You must be signed in to change notification settings - Fork 849
hrw: Supports indexed query parameters as conds #12822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
|
I addressed Co-Pilot's suggestions, most where very nit-picky, one was wrong. :) |
|
[approve ci osx] |
Co-author / ideas: Miles