summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2013-10-18 18:13:44 +0400
committerMaxim Dounin <mdounin@mdounin.ru>2013-10-18 18:13:44 +0400
commit6291a299925e2de2fc7c8793423d62b029ffab92 (patch)
tree2d94ba5ae4695202809f6d5318e7744571a2c67c
parent0ca52adff69a5f4c59172127aaf94c7162da7823 (diff)
downloadnginx-6291a299925e2de2fc7c8793423d62b029ffab92.tar.gz
nginx-6291a299925e2de2fc7c8793423d62b029ffab92.tar.bz2
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.
-rw-r--r--src/http/modules/ngx_http_headers_filter_module.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_headers_filter_module.c b/src/http/modules/ngx_http_headers_filter_module.c
index 0dfe8101e..e33e7ce52 100644
--- a/src/http/modules/ngx_http_headers_filter_module.c
+++ b/src/http/modules/ngx_http_headers_filter_module.c
@@ -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) {