Allow specifying multiple matcher sets in "not" matcher #3208
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.
A "not" matcher now accepts an array of matcher sets, rather than a single matcher set.
Matcher sets are OR'ed (i.e. if any matcher sets return true, this matcher returns false; if all matcher sets return false, this matcher returns true). This is analogous with how matcher sets work in routes.
Matchers within the same set are the same (i.e. they are AND'ed).
In the Caddyfile, if
not
appears multiple times in the same set, each occurrence creates a new matcher set within a single "not" matcher; in other words, multiplenot
s are effectively OR'ed because they create a single matcher (that is AND'ed with the others).See https://caddy.community/t/v2-matcher-or-in-not/7355/
/cc @princemaple - please try this out and confirm that it works for you! Thanks!