Skip to content

Fix MATCH_SET parsing of quoted items and add tests#13024

Open
cmcfarlen wants to merge 3 commits intoapache:masterfrom
cmcfarlen:hrw-fix-set-parse-quote
Open

Fix MATCH_SET parsing of quoted items and add tests#13024
cmcfarlen wants to merge 3 commits intoapache:masterfrom
cmcfarlen:hrw-fix-set-parse-quote

Conversation

@cmcfarlen
Copy link
Copy Markdown
Contributor

The set parser was incorrectly advancing 'start' by skip_quotes after a comma, causing the second and subsequent quoted items to be parsed with their leading characters truncated.

Add a unit test for quoted set parsing and enable the test_matcher build target (fix linker issue by removing resources.cc and adding stubs). Add autest coverage for quoted sets in header_rewrite bundle.

The set parser was incorrectly advancing 'start' by skip_quotes
after a comma, causing the second and subsequent quoted items to
be parsed with their leading characters truncated.

Add a unit test for quoted set parsing and enable the test_matcher
build target (fix linker issue by removing resources.cc and adding
stubs). Add autest coverage for quoted sets in header_rewrite
bundle.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cmcfarlen cmcfarlen added this to the 11.0.0 milestone Mar 26, 2026
@cmcfarlen cmcfarlen self-assigned this Mar 26, 2026
@cmcfarlen cmcfarlen added the header_rewrite header_rewrite plugin label Mar 26, 2026
Copy link
Copy Markdown
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

Fixes MATCH_SET parsing in the header_rewrite plugin so quoted list items after the first element aren’t truncated, and adds regression coverage in both unit tests and gold tests.

Changes:

  • Adjust MATCH_SET parsing cursor advancement for quoted items.
  • Add Catch2 unit test coverage for quoted set parsing.
  • Add gold test rules and replay transactions to validate quoted set matching behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/gold_tests/pluginTest/header_rewrite/rules/rule_client.conf Adds a new rule to exercise quoted set matching in SEND_RESPONSE_HDR_HOOK.
tests/gold_tests/pluginTest/header_rewrite/header_rewrite_bundle.replay.yaml Adds two replay transactions validating quoted set match/non-match behavior.
plugins/header_rewrite/matcher_tests.cc Adds stubs to make matcher tests linkable without full resources implementation and adds a quoted set unit test.
plugins/header_rewrite/matcher.h Changes MATCH_SET parsing to avoid truncating subsequent quoted items.
plugins/header_rewrite/CMakeLists.txt Adjusts (commented) test_matcher target lines and linker notes/handling.

@bryancall bryancall requested review from bryancall and removed request for bneradt March 30, 2026 22:23
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

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants