diff src/http/ngx_http_header_filter_module.c @ 2346:b274942c09c3 stable-0.6

r2052, r2082 merge: "gzip_vary on" always sends "Vary: Accept-Encoding" header
author Igor Sysoev <igor@sysoev.ru>
date Thu, 27 Nov 2008 14:12:18 +0000
parents 65cff41e9a4e
children
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,12 @@ ngx_http_header_filter(ngx_http_request_
         len += sizeof("Connection: closed" CRLF) - 1;
     }
 
+#if (NGX_HTTP_GZIP)
+    if (r->gzip && clcf->gzip_vary) {
+        len += sizeof("Vary: Accept-Encoding" CRLF) - 1;
+    }
+#endif
+
     part = &r->headers_out.headers.part;
     header = part->elts;
 
@@ -516,6 +522,13 @@ ngx_http_header_filter(ngx_http_request_
                              sizeof("Connection: close" CRLF) - 1);
     }
 
+#if (NGX_HTTP_GZIP)
+    if (r->gzip && clcf->gzip_vary) {
+        b->last = ngx_cpymem(b->last, "Vary: Accept-Encoding" CRLF,
+                             sizeof("Vary: Accept-Encoding" CRLF) - 1);
+    }
+#endif
+
     part = &r->headers_out.headers.part;
     header = part->elts;