mirror of
https://github.com/caddyserver/website.git
synced 2025-04-20 12:15:08 -04:00
Header replacement defer
This commit is contained in:
parent
43ac227b6c
commit
d17e10406e
1 changed files with 12 additions and 3 deletions
|
@ -13,9 +13,6 @@ By default, header operations are performed immediately unless any of the header
|
||||||
|
|
||||||
```caddy-d
|
```caddy-d
|
||||||
header [<matcher>] [[+|-|?|>]<field> [<value>|<find>] [<replace>]] {
|
header [<matcher>] [[+|-|?|>]<field> [<value>|<find>] [<replace>]] {
|
||||||
# Replace
|
|
||||||
<field> <find> <replace>
|
|
||||||
|
|
||||||
# Add
|
# Add
|
||||||
+<field> <value>
|
+<field> <value>
|
||||||
|
|
||||||
|
@ -28,6 +25,12 @@ header [<matcher>] [[+|-|?|>]<field> [<value>|<find>] [<replace>]] {
|
||||||
# Delete
|
# Delete
|
||||||
-<field>
|
-<field>
|
||||||
|
|
||||||
|
# Replace
|
||||||
|
<field> <find> <replace>
|
||||||
|
|
||||||
|
# Replace with defer
|
||||||
|
><field> <find> <replace>
|
||||||
|
|
||||||
# Default
|
# Default
|
||||||
?<field> <value>
|
?<field> <value>
|
||||||
|
|
||||||
|
@ -121,3 +124,9 @@ To override the cache expiration that a proxy upstream had set for paths startin
|
||||||
header /no-cache* >Cache-Control nocache
|
header /no-cache* >Cache-Control nocache
|
||||||
reverse_proxy upstream:443
|
reverse_proxy upstream:443
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To perform a deferred update of a `Set-Cookie` header to add `SameSite=None`; a regexp capture is used to grab the existing value, and `$1` re-inserts it at the start with the additional option appended:
|
||||||
|
|
||||||
|
```caddy-d
|
||||||
|
header >Set-Cookie (.*) "$1; SameSite=None;"
|
||||||
|
```
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue