aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules/caddyhttp/encode/encode.go
diff options
context:
space:
mode:
authorMatthew Holt <[email protected]>2019-06-30 23:38:36 -0600
committerMatthew Holt <[email protected]>2019-06-30 23:38:36 -0600
commit9f8d3611eb9e29d673542877c3cc06a7456a5eea (patch)
treee7c8ef94e3757a2d30a41357ad4e856fa16ade6d /modules/caddyhttp/encode/encode.go
parent3177ee8010fb22314efd3d9b5849ac514d089696 (diff)
downloadcaddy-9f8d3611eb9e29d673542877c3cc06a7456a5eea.tar.gz
caddy-9f8d3611eb9e29d673542877c3cc06a7456a5eea.zip
encode: Add "Vary" response header
Diffstat (limited to 'modules/caddyhttp/encode/encode.go')
-rw-r--r--modules/caddyhttp/encode/encode.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/caddyhttp/encode/encode.go b/modules/caddyhttp/encode/encode.go
index fc0a537d9..3eebe6862 100644
--- a/modules/caddyhttp/encode/encode.go
+++ b/modules/caddyhttp/encode/encode.go
@@ -219,6 +219,7 @@ func (rw *responseWriter) init() {
rw.w.Reset(rw.ResponseWriter)
rw.Header().Del("Content-Length") // https://github.com/golang/go/issues/14975
rw.Header().Set("Content-Encoding", rw.encodingName)
+ rw.Header().Add("Vary", "Accept-Encoding")
}
rw.Header().Del("Accept-Ranges") // we don't know ranges for dynamically-encoded content
}