]> git.kaiwu.me - nginx.git/commitdiff
Headers filter: empty Cache-Control is no longer added.
authorMaxim Dounin <mdounin@mdounin.ru>
Fri, 18 Oct 2013 14:13:44 +0000 (18:13 +0400)
committerMaxim Dounin <mdounin@mdounin.ru>
Fri, 18 Oct 2013 14:13:44 +0000 (18:13 +0400)
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.

src/http/modules/ngx_http_headers_filter_module.c

index 0dfe8101ed6be6479486a023317727ecfe74b65a..e33e7ce527172cb18ea9fe88282a2fc956962193 100644 (file)
@@ -339,6 +339,10 @@ ngx_http_add_cache_control(ngx_http_request_t *r, ngx_http_header_val_t *hv,
 {
     ngx_table_elt_t  *cc, **ccp;
 
+    if (value->len == 0) {
+        return NGX_OK;
+    }
+
     ccp = r->headers_out.cache_control.elts;
 
     if (ccp == NULL) {