diff --git a/src/http/ngx_http_variables.c b/src/http/ngx_http_variables.c index e6db0b7c6..374a29e70 100644 --- a/src/http/ngx_http_variables.c +++ b/src/http/ngx_http_variables.c @@ -640,7 +640,7 @@ ngx_http_variable_unknown_header(ngx_http_variable_value_t *v, ngx_str_t *var, } } - if (n + prefix == var->len) { + if (n + prefix == var->len && n == header[i].key.len) { v->len = header[i].value.len; v->valid = 1; v->no_cachable = 0;