summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-11-16 15:16:47 +0000
committerIgor Sysoev <igor@sysoev.ru>2009-11-16 15:16:47 +0000
commitbf6c11e928d505d987a57258df31ab3bcc5bf590 (patch)
tree8dc2fa16688424c8e65df3c32fb7ba5ffc10ec1a
parentde6c14ed3ed5cae07b935819286916321d6fd2cd (diff)
downloadnginx-bf6c11e928d505d987a57258df31ab3bcc5bf590.tar.gz
nginx-bf6c11e928d505d987a57258df31ab3bcc5bf590.tar.bz2
r3313 merge:
nginx sent gzipped responses to clients those do not support gzip, if "gzip_static on" and "gzip_vary off"; the bug had been introduced in r3250
-rw-r--r--src/http/modules/ngx_http_gzip_static_module.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/http/modules/ngx_http_gzip_static_module.c b/src/http/modules/ngx_http_gzip_static_module.c
index 8080d9cb0..45ab6aaa2 100644
--- a/src/http/modules/ngx_http_gzip_static_module.c
+++ b/src/http/modules/ngx_http_gzip_static_module.c
@@ -99,9 +99,11 @@ ngx_http_gzip_static_handler(ngx_http_request_t *r)
return NGX_DECLINED;
}
+ rc = ngx_http_gzip_ok(r);
+
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
- if (clcf->gzip_vary && ngx_http_gzip_ok(r) != NGX_OK) {
+ if (!clcf->gzip_vary && rc != NGX_OK) {
return NGX_DECLINED;
}
@@ -162,6 +164,10 @@ ngx_http_gzip_static_handler(ngx_http_request_t *r)
return NGX_DECLINED;
}
+ if (rc != NGX_OK) {
+ return NGX_DECLINED;
+ }
+
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, "http static fd: %d", of.fd);
if (of.is_dir) {