comparison src/http/modules/ngx_http_headers_filter_module.c @ 2406:008777fa59e0

do not add header if add_header ""
author Igor Sysoev <igor@sysoev.ru>
date Mon, 15 Dec 2008 10:50:57 +0000
parents b4ffe603fa86
children a6954ce88b80
comparison
equal deleted inserted replaced
2405:5c0c7f65f8f0 2406:008777fa59e0
323 ngx_http_add_header(ngx_http_request_t *r, ngx_http_header_val_t *hv, 323 ngx_http_add_header(ngx_http_request_t *r, ngx_http_header_val_t *hv,
324 ngx_str_t *value) 324 ngx_str_t *value)
325 { 325 {
326 ngx_table_elt_t *h; 326 ngx_table_elt_t *h;
327 327
328 h = ngx_list_push(&r->headers_out.headers); 328 if (value->len) {
329 if (h == NULL) { 329 h = ngx_list_push(&r->headers_out.headers);
330 return NGX_ERROR; 330 if (h == NULL) {
331 } 331 return NGX_ERROR;
332 332 }
333 h->hash = hv->value.hash; 333
334 h->key = hv->value.key; 334 h->hash = hv->value.hash;
335 h->value = *value; 335 h->key = hv->value.key;
336 h->value = *value;
337 }
336 338
337 return NGX_OK; 339 return NGX_OK;
338 } 340 }
339 341
340 342