Fix case-insensitive word matcher missing dynamic (rendered) values#7523
Fix case-insensitive word matcher missing dynamic (rendered) values#7523Synvoya wants to merge 1 commit into
word matcher missing dynamic (rendered) values#7523Conversation
MatchWords lowercased the corpus and literal words but not the rendered template word, so a case-insensitive word matcher backed by a {{var}} that resolved to an uppercase value never matched (false negative). Lowercase the rendered word when CaseInsensitive is set.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughModified ChangesCase-Insensitive Word Matching Fix
Estimated code review effort: 1 (Trivial) | ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
A
wordmatcher withcase-insensitive: truefails to match when a template word (e.g.{{host}}, or a value chained from a prior extractor) resolves to a value containing uppercase letters.MatchWordslowercases the corpus, and compile lowercases the literal words, but the rendered dynamic word is never lowercased. Sostrings.Contains(lowercasedCorpus, "Example.COM")never matches — a missed detection / false negative for any case-insensitivewordmatcher backed by a dynamic value (extractor output, response headers likeServer:/Set-Cookie:, tokens, etc.).Fix
Lowercase the rendered word when
CaseInsensitiveis set. The literal-word path is unchanged (already folded to lowercase at compile time).Test
Added
TestMatchWords_CaseInsensitive_DynamicValueinpkg/operators/matchers/match_test.go.go test ./pkg/operators/matchers/passes (new test + existing).Summary by CodeRabbit
Bug Fixes
Tests