From 0917548c4f7e7dcf19cfc00935fed2d302a628e7 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Thu, 25 Jul 2024 19:18:22 -0400 Subject: [PATCH] Adjust header ? explanation to match behaviour --- src/docs/markdown/caddyfile/directives/header.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docs/markdown/caddyfile/directives/header.md b/src/docs/markdown/caddyfile/directives/header.md index 76ee347..1bff8d9 100644 --- a/src/docs/markdown/caddyfile/directives/header.md +++ b/src/docs/markdown/caddyfile/directives/header.md @@ -62,7 +62,7 @@ header [] [[+|-|?|>] [|] []] { For multiple header manipulations, you can open a block and specify one manipulation per line in the same way. -When using the `?` prefix to set a default header value, it is recommended to separate this into its own `header` directive. [Under the hood](/docs/modules/http.handlers.headers#response/require), using `?` configures a response matcher which applies to the directive's entire handler, which only applies the header operations if the field is not yet set. For example, in the same directive, you have these two manipulations: `-Hidden` and `?Foo default`, then the `Hidden` header is _only_ removed if `Foo` is empty, which is typically not the intended effect. +When using the `?` prefix to set a default header value, it is automatically separated into its own `header` handler, if it was in a `header` block with multiple header operations. [Under the hood](/docs/modules/http.handlers.headers#response/require), using `?` configures a response matcher which applies to the directive's entire handler, which only applies the header operations (like `defer`), but only if the field is not yet set. ## Examples