Skip to content

Commit

Permalink
middleware: set Vary header if compressed
Browse files Browse the repository at this point in the history
  • Loading branch information
aaharu authored and pkieltyka committed Apr 30, 2019
1 parent af3b6a3 commit 988e36e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions middleware/compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ func (cw *compressResponseWriter) WriteHeader(code int) {

if cw.encoding != "" {
cw.Header().Set("Content-Encoding", cw.encoding)
cw.Header().Set("Vary", "Accept-Encoding")

// The content-length after compression is unknown
cw.Header().Del("Content-Length")
Expand Down

0 comments on commit 988e36e

Please sign in to comment.