comparison src/http/modules/ngx_http_headers_filter_module.c @ 5427:7ed23dcfea3d

Headers filter: empty Cache-Control is no longer added. Much like with other headers, "add_header Cache-Control $value;" no longer results in anything added to response headers if $value evaluates to an empty string.
author Maxim Dounin <mdounin@mdounin.ru>
date Fri, 18 Oct 2013 18:13:44 +0400
parents 837d0a1bc31c
children 74ffe03555d0
comparison
equal deleted inserted replaced
5426:4bfa982dbf0e 5427:7ed23dcfea3d
337 ngx_http_add_cache_control(ngx_http_request_t *r, ngx_http_header_val_t *hv, 337 ngx_http_add_cache_control(ngx_http_request_t *r, ngx_http_header_val_t *hv,
338 ngx_str_t *value) 338 ngx_str_t *value)
339 { 339 {
340 ngx_table_elt_t *cc, **ccp; 340 ngx_table_elt_t *cc, **ccp;
341 341
342 if (value->len == 0) {
343 return NGX_OK;
344 }
345
342 ccp = r->headers_out.cache_control.elts; 346 ccp = r->headers_out.cache_control.elts;
343 347
344 if (ccp == NULL) { 348 if (ccp == NULL) {
345 349
346 if (ngx_array_init(&r->headers_out.cache_control, r->pool, 350 if (ngx_array_init(&r->headers_out.cache_control, r->pool,