mirror of
https://github.com/caddyserver/website.git
synced 2025-06-17 19:55:09 -04:00
2.5.2 docs (#247)
* docs: Changes for v2.5.2 release * docs: Remove -X POST Curl automatically uses POST for -d and --data-binary. I intentionally left it in to be explicit to learners, but maybe best practices are better. * api: /adapt endpoint and Etag usage * api: Minor tweaks * Alright fine * Clarify Etag usage * CEL embedded matchers * Oops * Lots more adjustments Co-authored-by: Francis Lavoie <lavofr@gmail.com>
This commit is contained in:
parent
522d1961d1
commit
7819a84e59
30 changed files with 529 additions and 164 deletions
|
@ -12,20 +12,37 @@ By default, header operations are performed immediately unless any of the header
|
|||
## Syntax
|
||||
|
||||
```caddy-d
|
||||
header [<matcher>] [[+|-|?]<field> [<value>|<find>|<default_value>] [<replace>]] {
|
||||
header [<matcher>] [[+|-|?]<field> [<value>|<find>] [<replace>]] {
|
||||
# Replace
|
||||
<field> <find> <replace>
|
||||
|
||||
# Add or Set
|
||||
[+]<field> <value>
|
||||
|
||||
# Delete
|
||||
-<field>
|
||||
?<field> <default_value>
|
||||
|
||||
# Default
|
||||
?<field> <value>
|
||||
|
||||
[defer]
|
||||
}
|
||||
```
|
||||
|
||||
- **<field>** is the name of the header field. By default, will overwrite any existing field of the same name. Prefix with `+` to add the field instead of replace, or prefix with `-` to remove the field.
|
||||
- **<field>** is the name of the header field. By default, will overwrite any existing field of the same name.
|
||||
|
||||
Prefix with `+` to add the field instead of overwriting (setting) the field if it already exists; header fields can appear more than once in a request.
|
||||
|
||||
Prefix with `-` to delete the field. The field may use prefix or suffix `*` wildcards to delete all matching fields.
|
||||
|
||||
Prefix with `?` to set a default value for the field. The field is only written if it doesn't yet exist.
|
||||
|
||||
- **<value>** is the header field value, if adding or setting a field.
|
||||
- **<default_value>** is the header field value that will be set only if the header does not already exist.
|
||||
|
||||
- **<find>** is the substring or regular expression to search for.
|
||||
|
||||
- **<replace>** is the replacement value; required if performing a search-and-replace.
|
||||
|
||||
- **defer** will force the header operations to be deferred until the response is being written out to the client. This is automatically enabled if any of the header fields are being deleted with `-`, or when setting a default value with `?`.
|
||||
|
||||
For multiple header manipulations, you can open a block and specify one manipulation per line in the same way.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue