Mercurial > hg > nginx
changeset 3249:1966ba1d76fd stable-0.7
merge r3055, r3136:
gzip related fixes:
*) do not disable gzip for MSIE 6.0 SV1 in "gzip_disable msie6"
*) nginx always sent "Vary: Accept-Encoding",
if both gzip_static and gzip_vary were on
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 26 Oct 2009 17:34:43 +0000 |
parents | 8c76116820f3 |
children | cfc35172c7fd |
files | src/http/modules/ngx_http_gzip_static_module.c src/http/ngx_http_request.c |
diffstat | 2 files changed, 14 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_gzip_static_module.c Mon Oct 26 17:32:17 2009 +0000 +++ b/src/http/modules/ngx_http_gzip_static_module.c Mon Oct 26 17:34:43 2009 +0000 @@ -95,7 +95,13 @@ gzcf = ngx_http_get_module_loc_conf(r, ngx_http_gzip_static_module); - if (!gzcf->enable || ngx_http_gzip_ok(r) != NGX_OK) { + if (!gzcf->enable) { + return NGX_DECLINED; + } + + clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); + + if (clcf->gzip_vary && ngx_http_gzip_ok(r) != NGX_OK) { return NGX_DECLINED; } @@ -116,8 +122,6 @@ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, "http filename: \"%s\"", path.data); - clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); - ngx_memzero(&of, sizeof(ngx_open_file_info_t)); of.directio = clcf->directio; @@ -138,6 +142,7 @@ case NGX_ENOTDIR: case NGX_ENAMETOOLONG: + r->gzip = 0; return NGX_DECLINED; case NGX_EACCES:
--- a/src/http/ngx_http_request.c Mon Oct 26 17:32:17 2009 +0000 +++ b/src/http/ngx_http_request.c Mon Oct 26 17:34:43 2009 +0000 @@ -1378,8 +1378,13 @@ r->headers_in.msie4 = 1; /* fall through */ case '5': + r->headers_in.msie6 = 1; + break; case '6': - r->headers_in.msie6 = 1; + if (ngx_strstrn(msie + 8, "SV1", 3 - 1) == NULL) { + r->headers_in.msie6 = 1; + } + break; } }