]> git.kaiwu.me - nginx.git/commitdiff
add charset for ngx_http_gzip_static_module responses
authorIgor Sysoev <igor@sysoev.ru>
Fri, 22 May 2009 11:05:26 +0000 (11:05 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Fri, 22 May 2009 11:05:26 +0000 (11:05 +0000)
src/http/modules/ngx_http_charset_filter_module.c
src/http/modules/ngx_http_gzip_static_module.c
src/http/ngx_http_request.h

index cccab4c5a03b5c433a106a9f4c459cdd3d0f96e1..4efbce76d5987314fdbcd99959a443a9879fd9d4 100644 (file)
@@ -224,7 +224,8 @@ ngx_http_charset_header_filter(ngx_http_request_t *r)
 
     if (r == r->main) {
 
-        if (r->headers_out.content_encoding
+        if (!r->ignore_content_encoding
+            && r->headers_out.content_encoding
             && r->headers_out.content_encoding->value.len)
         {
             return ngx_http_next_header_filter(r);
index a1848628a88ae6f8b1b47bc92991e1b754bfd113..22e806ac3b3316afd9e9f4431eee9d1238d1c75a 100644 (file)
@@ -205,6 +205,7 @@ ngx_http_gzip_static_handler(ngx_http_request_t *r)
     h->value.data = (u_char *) "gzip";
 
     r->headers_out.content_encoding = h;
+    r->ignore_content_encoding = 1;
 
     /* we need to allocate all before the header would be sent */
 
index 4fef7c36cab74b4609407f81c32e94e9d0731b48..97ffbbf21caa848f5da185db6540be8106414832 100644 (file)
@@ -478,6 +478,7 @@ struct ngx_http_request_s {
     unsigned                          discard_body:1;
     unsigned                          internal:1;
     unsigned                          error_page:1;
+    unsigned                          ignore_content_encoding:1;
     unsigned                          filter_finalize:1;
     unsigned                          post_action:1;
     unsigned                          request_complete:1;