Fix MATCH_SET parsing of quoted items and add tests#13024
Open
cmcfarlen wants to merge 3 commits intoapache:masterfrom
Open
Fix MATCH_SET parsing of quoted items and add tests#13024cmcfarlen wants to merge 3 commits intoapache:masterfrom
cmcfarlen wants to merge 3 commits intoapache:masterfrom
Conversation
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>
Contributor
There was a problem hiding this comment.
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_SETparsing 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. |
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.
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.