# HG changeset patch # User Igor Sysoev # Date 1229338257 0 # Node ID 008777fa59e0c99d5b6caba17154f8b567133408 # Parent 5c0c7f65f8f08fe3148462d0d38f0fbd566ba989 do not add header if add_header "" diff --git a/src/http/modules/ngx_http_headers_filter_module.c b/src/http/modules/ngx_http_headers_filter_module.c --- a/src/http/modules/ngx_http_headers_filter_module.c +++ b/src/http/modules/ngx_http_headers_filter_module.c @@ -325,15 +325,17 @@ ngx_http_add_header(ngx_http_request_t * { ngx_table_elt_t *h; - h = ngx_list_push(&r->headers_out.headers); - if (h == NULL) { - return NGX_ERROR; + if (value->len) { + h = ngx_list_push(&r->headers_out.headers); + if (h == NULL) { + return NGX_ERROR; + } + + h->hash = hv->value.hash; + h->key = hv->value.key; + h->value = *value; } - h->hash = hv->value.hash; - h->key = hv->value.key; - h->value = *value; - return NGX_OK; }