Skip to content

Conversation

@zwoop
Copy link
Contributor

@zwoop zwoop commented Jan 16, 2026

Co-author / ideas: Miles

@zwoop zwoop added this to the 10.2.0 milestone Jan 16, 2026
@zwoop zwoop self-assigned this Jan 16, 2026
@zwoop zwoop added the header_rewrite header_rewrite plugin label Jan 16, 2026
Copy link
Contributor

Copilot AI left a 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.

@zwoop
Copy link
Contributor Author

zwoop commented Jan 16, 2026

I addressed Co-Pilot's suggestions, most where very nit-picky, one was wrong. :)

@zwoop
Copy link
Contributor Author

zwoop commented Jan 20, 2026

[approve ci osx]

@zwoop zwoop requested review from bneradt and mlibbey January 21, 2026 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

header_rewrite header_rewrite plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant