comparison src/http/modules/ngx_http_headers_filter_module.c @ 6405:5dfc63c1d9ca

Headers filter: fixed "add_header ... '' always". The "always" parameter was ignored if the header value was empty.
author Ruslan Ermilov <ru@nginx.com>
date Thu, 18 Feb 2016 15:49:11 +0300
parents 8b6fa4842133
children be5cfa918bfc
comparison
equal deleted inserted replaced
6404:09d5a22c76bd 6405:5dfc63c1d9ca
710 break; 710 break;
711 } 711 }
712 712
713 if (value[2].len == 0) { 713 if (value[2].len == 0) {
714 ngx_memzero(&hv->value, sizeof(ngx_http_complex_value_t)); 714 ngx_memzero(&hv->value, sizeof(ngx_http_complex_value_t));
715 return NGX_CONF_OK; 715
716 } 716 } else {
717 717 ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
718 ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); 718
719 719 ccv.cf = cf;
720 ccv.cf = cf; 720 ccv.value = &value[2];
721 ccv.value = &value[2]; 721 ccv.complex_value = &hv->value;
722 ccv.complex_value = &hv->value; 722
723 723 if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
724 if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { 724 return NGX_CONF_ERROR;
725 return NGX_CONF_ERROR; 725 }
726 } 726 }
727 727
728 if (cf->args->nelts == 3) { 728 if (cf->args->nelts == 3) {
729 return NGX_CONF_OK; 729 return NGX_CONF_OK;
730 } 730 }