mirror of
https://github.com/nginx/nginx.git
synced 2025-06-10 19:42:39 +08:00
Headers filter: fixed "add_header ... '' always".
The "always" parameter was ignored if the header value was empty.
This commit is contained in:
parent
fef872a9ba
commit
73f815e489
@ -712,17 +712,17 @@ ngx_http_headers_add(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
|
|
||||||
if (value[2].len == 0) {
|
if (value[2].len == 0) {
|
||||||
ngx_memzero(&hv->value, sizeof(ngx_http_complex_value_t));
|
ngx_memzero(&hv->value, sizeof(ngx_http_complex_value_t));
|
||||||
return NGX_CONF_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
|
} else {
|
||||||
|
ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
|
||||||
|
|
||||||
ccv.cf = cf;
|
ccv.cf = cf;
|
||||||
ccv.value = &value[2];
|
ccv.value = &value[2];
|
||||||
ccv.complex_value = &hv->value;
|
ccv.complex_value = &hv->value;
|
||||||
|
|
||||||
if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
|
if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
|
||||||
return NGX_CONF_ERROR;
|
return NGX_CONF_ERROR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cf->args->nelts == 3) {
|
if (cf->args->nelts == 3) {
|
||||||
|
Loading…
Reference in New Issue
Block a user