aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@nginx.com>2016-02-18 15:49:11 +0300
committerRuslan Ermilov <ru@nginx.com>2016-02-18 15:49:11 +0300
commit73f815e48996ff5ab3a0b7a5fa436bf315371e25 (patch)
treea449cb4bc9ce8dc1cda52ac60b2b13f66b2fa436 /src
parentfef872a9ba628a105504b6ef4653cfd1560f8e79 (diff)
downloadnginx-73f815e48996ff5ab3a0b7a5fa436bf315371e25.tar.gz
nginx-73f815e48996ff5ab3a0b7a5fa436bf315371e25.zip
Headers filter: fixed "add_header ... '' always".
The "always" parameter was ignored if the header value was empty.
Diffstat (limited to 'src')
-rw-r--r--src/http/modules/ngx_http_headers_filter_module.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/http/modules/ngx_http_headers_filter_module.c b/src/http/modules/ngx_http_headers_filter_module.c
index 985e5b335..6738afe9f 100644
--- a/src/http/modules/ngx_http_headers_filter_module.c
+++ b/src/http/modules/ngx_http_headers_filter_module.c
@@ -712,17 +712,17 @@ ngx_http_headers_add(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
if (value[2].len == 0) {
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.value = &value[2];
- ccv.complex_value = &hv->value;
+ ccv.cf = cf;
+ ccv.value = &value[2];
+ ccv.complex_value = &hv->value;
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
+ if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
+ return NGX_CONF_ERROR;
+ }
}
if (cf->args->nelts == 3) {