add charset for ngx_http_gzip_static_module responses
diff --git a/src/http/modules/ngx_http_charset_filter_module.c b/src/http/modules/ngx_http_charset_filter_module.c index cccab4c..4efbce7 100644 --- a/src/http/modules/ngx_http_charset_filter_module.c +++ b/src/http/modules/ngx_http_charset_filter_module.c
@@ -224,7 +224,8 @@ 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);
diff --git a/src/http/modules/ngx_http_gzip_static_module.c b/src/http/modules/ngx_http_gzip_static_module.c index a184862..22e806a 100644 --- a/src/http/modules/ngx_http_gzip_static_module.c +++ b/src/http/modules/ngx_http_gzip_static_module.c
@@ -205,6 +205,7 @@ 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 */
diff --git a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h index 4fef7c3..97ffbbf 100644 --- a/src/http/ngx_http_request.h +++ b/src/http/ngx_http_request.h
@@ -478,6 +478,7 @@ 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;