summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2019-06-30 23:38:36 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2019-06-30 23:38:36 -0600
commit9f8d3611eb9e29d673542877c3cc06a7456a5eea (patch)
treee7c8ef94e3757a2d30a41357ad4e856fa16ade6d
parent3177ee8010fb22314efd3d9b5849ac514d089696 (diff)
encode: Add "Vary" response header
-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 fc0a537..3eebe68 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
}