summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/headers/headers.go
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2020-02-04 11:05:32 -0700
committerMatthew Holt <mholt@users.noreply.github.com>2020-02-04 11:05:32 -0700
commit9639fe7d2864848f72c8ca3adae025954cbfec1f (patch)
tree03f7a02e9ee35a224cc38dfa28a0fe59065dc9df /modules/caddyhttp/headers/headers.go
parent3592e593990d8ae1ca6aec0f5a6d5a0cfa83cf4c (diff)
header: caddyfile: Defer header operations for deletions or manually
See https://caddy.community/t/caddy-server-that-returns-only-ip-address-as-text/6928/6?u=matt In most cases, we will want to apply header operations immediately, rather than waiting until the response is written. The exceptions are generally going to be if we are deleting a header field or if a field is to be overwritten. We now automatically defer header ops if deleting a header field, and allow the user to manually enable deferred mode with the defer subdirective.
Diffstat (limited to 'modules/caddyhttp/headers/headers.go')
-rw-r--r--modules/caddyhttp/headers/headers.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/caddyhttp/headers/headers.go b/modules/caddyhttp/headers/headers.go
index 8dec42c..681c21f 100644
--- a/modules/caddyhttp/headers/headers.go
+++ b/modules/caddyhttp/headers/headers.go
@@ -178,6 +178,8 @@ type RespHeaderOps struct {
// If true, header operations will be deferred until
// they are written out. Superceded if Require is set.
+ // Usually you will need to set this to true if any
+ // fields are being deleted.
Deferred bool `json:"deferred,omitempty"`
}