mirror of
https://github.com/caddyserver/website.git
synced 2025-04-21 20:46:15 -04:00
docs: Update header directive with regards to defer
This commit is contained in:
parent
0e0134f254
commit
3c6202c15d
1 changed files with 4 additions and 0 deletions
|
@ -6,6 +6,8 @@ title: header (Caddyfile directive)
|
|||
|
||||
Manipulates HTTP header fields on the response. It can set, add, and delete header values, or perform replacements using regular expressions.
|
||||
|
||||
By default, header operations are performed immediately unless any of the headers are being deleted, in which case the header operations are automatically deferred until the time they are being written to the client.
|
||||
|
||||
|
||||
## Syntax
|
||||
|
||||
|
@ -14,6 +16,7 @@ header [<matcher>] [[+|-]<field> [<value>|<find>] [<replace>]] {
|
|||
<field> <find> <replace>
|
||||
[+]<field> <value>
|
||||
-<field>
|
||||
[defer]
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -21,6 +24,7 @@ header [<matcher>] [[+|-]<field> [<value>|<find>] [<replace>]] {
|
|||
- **<value>** is the header field value, if adding or setting a field.
|
||||
- **<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 written out to the client. This is automatically enabled if any of the header fields are being deleted.
|
||||
|
||||
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