aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2008-12-15 10:50:57 +0000
committerIgor Sysoev <igor@sysoev.ru>2008-12-15 10:50:57 +0000
commit2194e75bb326a266e21f93cf159595a45661f91b (patch)
tree461485def190e1aae261dd1ebd168eef4ba242bb /src
parent4f395dec87dacfde58a211a948babaed306f3a69 (diff)
downloadnginx-2194e75bb326a266e21f93cf159595a45661f91b.tar.gz
nginx-2194e75bb326a266e21f93cf159595a45661f91b.zip
do not add header if add_header ""
Diffstat (limited to 'src')
-rw-r--r--src/http/modules/ngx_http_headers_filter_module.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/http/modules/ngx_http_headers_filter_module.c b/src/http/modules/ngx_http_headers_filter_module.c
index f4a6fe76f..764ddc94c 100644
--- a/src/http/modules/ngx_http_headers_filter_module.c
+++ b/src/http/modules/ngx_http_headers_filter_module.c
@@ -325,14 +325,16 @@ ngx_http_add_header(ngx_http_request_t *r, ngx_http_header_val_t *hv,
{
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;
}