diff src/http/ngx_http_header_filter_module.c @ 2051:115e6f029fcc

"gzip_vary on" always sends "Vary: Accept-Encoding" header
author Igor Sysoev <igor@sysoev.ru>
date Fri, 20 Jun 2008 14:41:03 +0000
parents 7018254cc006
children 8488178092f2
line wrap: on
line diff
--- a/src/http/ngx_http_header_filter_module.c
+++ b/src/http/ngx_http_header_filter_module.c
@@ -347,6 +347,10 @@ ngx_http_header_filter(ngx_http_request_
         len += sizeof("Connection: closed" CRLF) - 1;
     }
 
+    if (r->gzip && clcf->gzip_vary) {
+        len += sizeof("Vary: Accept-Encoding" CRLF) - 1;
+    }
+
     part = &r->headers_out.headers.part;
     header = part->elts;
 
@@ -516,6 +520,11 @@ ngx_http_header_filter(ngx_http_request_
                              sizeof("Connection: close" CRLF) - 1);
     }
 
+    if (r->gzip && clcf->gzip_vary) {
+        b->last = ngx_cpymem(b->last, "Vary: Accept-Encoding" CRLF,
+                             sizeof("Vary: Accept-Encoding" CRLF) - 1);
+    }
+
     part = &r->headers_out.headers.part;
     header = part->elts;