docs: Add handle_errors, CEL matcher; a few other improvements

This commit is contained in:
Matthew Holt 2020-03-24 17:14:09 -06:00
parent e8e0ec148b
commit f4a2d34127
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5
5 changed files with 45 additions and 1 deletions

View file

@ -121,6 +121,7 @@ For most matchers that accept multiple values, those values are OR'ed; i.e. one
Full matcher documentation can be found [in each respective matcher module's docs](/docs/json/apps/http/servers/routes/match/).
- [expression](#expression)
- [file](#file)
- [header](#header)
- [header_regexp](#header-regexp)
@ -134,6 +135,26 @@ Full matcher documentation can be found [in each respective matcher module's doc
- [remote_ip](#remote-ip)
### expression
```
expression <cel...>
```
By any [CEL (Common Expression Language)](https://github.com/google/cel-spec) expression that returns `true` or `false`.
⚠️ This module is still experimental and, as such, may experience breaking changes.
As a special case, Caddy [placeholders](/docs/conventions#placeholders) (or [Caddyfile shorthands](/docs/caddyfile/concepts#placeholders)) may be used in these CEL expressions, as they are preprocessed and converted to regular CEL function calls before being interpreted by the CEL environment.
Examples:
```
expression {method}.startsWith("P")
```
### file
```