Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow specifying multiple matcher sets in "not" matcher #3208

Merged
merged 1 commit into from
Apr 1, 2020
Merged

Conversation

mholt
Copy link
Member

@mholt mholt commented Mar 31, 2020

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, multiple nots 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!

@mholt mholt added this to the v2.0.0-rc.1 milestone Mar 31, 2020
@princemaple
Copy link

👍 thanks!

@mholt mholt merged commit 73643ea into master Apr 1, 2020
@mholt mholt deleted the not-matcher branch April 1, 2020 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants