diff options
author | Igor Sysoev <igor@sysoev.ru> | 2009-11-11 21:12:41 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2009-11-11 21:12:41 +0000 |
commit | 2c0b6f3e70a7a4c277fec04d13845f0895ff2a04 (patch) | |
tree | b329df86c2b05579e40fc18678f82674a3acfefb /src | |
parent | f4992bbe148d09c8d71cb0e38e9629a202f0fe6a (diff) | |
download | nginx-2c0b6f3e70a7a4c277fec04d13845f0895ff2a04.tar.gz nginx-2c0b6f3e70a7a4c277fec04d13845f0895ff2a04.zip |
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 r3136
Diffstat (limited to 'src')
-rw-r--r-- | src/http/modules/ngx_http_gzip_static_module.c | 8 |
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 25ab64ca4..cff23e02a 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; } @@ -163,6 +165,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) { |