Headers filter: fixed "add_header ... '' always".
The "always" parameter was ignored if the header value was empty.
Ruslan Ermilov
6 years ago
711 | 711 | |
712 | 712 | if (value[2].len == 0) { |
713 | 713 | ngx_memzero(&hv->value, sizeof(ngx_http_complex_value_t)); |
714 | return NGX_CONF_OK; | |
715 | } | |
716 | ||
717 | ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); | |
718 | ||
719 | ccv.cf = cf; | |
720 | ccv.value = &value[2]; | |
721 | ccv.complex_value = &hv->value; | |
722 | ||
723 | if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { | |
724 | return NGX_CONF_ERROR; | |
714 | ||
715 | } else { | |
716 | ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); | |
717 | ||
718 | ccv.cf = cf; | |
719 | ccv.value = &value[2]; | |
720 | ccv.complex_value = &hv->value; | |
721 | ||
722 | if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { | |
723 | return NGX_CONF_ERROR; | |
724 | } | |
725 | 725 | } |
726 | 726 | |
727 | 727 | if (cf->args->nelts == 3) { |