diff options
author | Igor Sysoev <igor@sysoev.ru> | 2009-05-22 11:05:26 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2009-05-22 11:05:26 +0000 |
commit | 93c483e0c5b17f04e37a80c2fa2e22e24a0c2492 (patch) | |
tree | d99cf957a1ac9f0c589a2542c5b696e60cd7652d /src | |
parent | a7021768a7ae59d821293174476dc74d7d0e0ada (diff) | |
download | nginx-93c483e0c5b17f04e37a80c2fa2e22e24a0c2492.tar.gz nginx-93c483e0c5b17f04e37a80c2fa2e22e24a0c2492.zip |
add charset for ngx_http_gzip_static_module responses
Diffstat (limited to 'src')
-rw-r--r-- | src/http/modules/ngx_http_charset_filter_module.c | 3 | ||||
-rw-r--r-- | src/http/modules/ngx_http_gzip_static_module.c | 1 | ||||
-rw-r--r-- | src/http/ngx_http_request.h | 1 |
3 files changed, 4 insertions, 1 deletions
diff --git a/src/http/modules/ngx_http_charset_filter_module.c b/src/http/modules/ngx_http_charset_filter_module.c index cccab4c5a..4efbce76d 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 @@ 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); diff --git a/src/http/modules/ngx_http_gzip_static_module.c b/src/http/modules/ngx_http_gzip_static_module.c index a1848628a..22e806ac3 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 @@ 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 */ diff --git a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h index 4fef7c36c..97ffbbf21 100644 --- a/src/http/ngx_http_request.h +++ b/src/http/ngx_http_request.h @@ -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; |