Mercurial > hg > nginx-quic
comparison src/http/modules/ngx_http_gzip_filter_module.c @ 3379:0c517d0cabe0
backout r3315 and test r->header_only last, since it's not actually
frequent here: 304 and HEAD responses are not set it before the filter
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 07 Dec 2009 15:41:57 +0000 |
parents | 6b8e5c882e47 |
children | dd1570b6f237 |
comparison
equal
deleted
inserted
replaced
3378:5d17022a1e88 | 3379:0c517d0cabe0 |
---|---|
241 ngx_http_gzip_conf_t *conf; | 241 ngx_http_gzip_conf_t *conf; |
242 | 242 |
243 conf = ngx_http_get_module_loc_conf(r, ngx_http_gzip_filter_module); | 243 conf = ngx_http_get_module_loc_conf(r, ngx_http_gzip_filter_module); |
244 | 244 |
245 if (!conf->enable | 245 if (!conf->enable |
246 || r->header_only | |
247 || (r->headers_out.status != NGX_HTTP_OK | 246 || (r->headers_out.status != NGX_HTTP_OK |
248 && r->headers_out.status != NGX_HTTP_FORBIDDEN | 247 && r->headers_out.status != NGX_HTTP_FORBIDDEN |
249 && r->headers_out.status != NGX_HTTP_NOT_FOUND) | 248 && r->headers_out.status != NGX_HTTP_NOT_FOUND) |
250 || (r->headers_out.content_encoding | 249 || (r->headers_out.content_encoding |
251 && r->headers_out.content_encoding->value.len) | 250 && r->headers_out.content_encoding->value.len) |
252 || (r->headers_out.content_length_n != -1 | 251 || (r->headers_out.content_length_n != -1 |
253 && r->headers_out.content_length_n < conf->min_length) | 252 && r->headers_out.content_length_n < conf->min_length) |
254 || ngx_http_test_content_type(r, &conf->types) == NULL) | 253 || ngx_http_test_content_type(r, &conf->types) == NULL |
254 || r->header_only) | |
255 { | 255 { |
256 return ngx_http_next_header_filter(r); | 256 return ngx_http_next_header_filter(r); |
257 } | 257 } |
258 | 258 |
259 r->gzip_vary = 1; | 259 r->gzip_vary = 1; |