Add regular expression support in header match#335
Add regular expression support in header match#335mattklein123 merged 6 commits intoenvoyproxy:masterfrom
Conversation
|
I would like people to understand that they are using regex, so I think we should actually opt-in via config. What do you think about having a parameter in the header match, "regex" which defaults to false, and if set to true does a regex match otherwise does what we do today? |
|
I would definitely be up for that. Should be easy to add as well. Do we need to do some additional scrubbing on the incoming request headers before passing it via a regex_match ? If so, are there any best practices or will the existing c++ regex subsystem suffice to handle super large headers, etc. ? |
|
@rshriram my knowledge of regex security is close to zero, so will definitely defer to others on best practices around scrubbing, etc. For now I think as long as it is opt-in and clearly documented we can proceed with a basic implementation. |
There was a problem hiding this comment.
Can you link out to the grammar: http://en.cppreference.com/w/cpp/regex/ecmascript
source/common/router/config_impl.cc
Outdated
There was a problem hiding this comment.
I know you didn't do this, but:
cfg_header_data.value_.empty()
source/common/router/config_impl.cc
Outdated
There was a problem hiding this comment.
nit: can you do regex case last since it will be less common, so invert logic and do !cfg_header_data.is_regex_
source/common/router/config_impl.h
Outdated
source/common/router/config_impl.h
Outdated
4a0ee29 to
88d5037
Compare
* Revert "Upgrade gRPC to v1.3.4 (envoyproxy#335)" This reverts commit f9bf1d9. * Revert "Update gRPC to v1.3.2 (envoyproxy#315)" This reverts commit 6f8953d.
Automatic merge from submit-queue. [DO NOT MERGE] Auto PR to update dependencies of mixerclient This PR will be merged automatically once checks are successful. ```release-note none ```
…stio#335) Signed-off-by: John Plevyak <jplevyak@gmail.com>
Signed-off-by: Jose Nino <jnino@lyft.com> Signed-off-by: JP Simard <jp@jpsim.com>
Signed-off-by: Jose Nino <jnino@lyft.com> Signed-off-by: JP Simard <jp@jpsim.com>
**Commit Message** Previously, the .bin directly was not cleared, so this fixes it. **Related Issues/PRs (if applicable)** Follow up on #329 Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
fixes #199
This PR adds support for C++ style regexes while matching request headers. There are no config syntax changes.