Handle predicate location variable error

Previously, the error was ignored and the predicate was treated as
false.  Now the error leads to the request finalization.
This commit is contained in:
Roman Arutyunyan authored and Roman Arutyunyan committed 2026-09-09 19:37:03 +04:00
1 parent 5c812c034e
commit 005f9f5d4d
1 file changed
+4 -1
+4 -1
View File
@@ -1514,8 +1514,11 @@ ngx_http_core_find_location(ngx_http_request_t *r)
"test location: \"%V\"", &(*clcfp)->name);
vv = ngx_http_get_flushed_variable(r, (*clcfp)->predicate - 1);
if (vv == NULL) {
return NGX_ERROR;
}
if (vv && vv->len && (vv->len != 1 || vv->data[0] != '0')) {
if (vv->len && (vv->len != 1 || vv->data[0] != '0')) {
r->loc_conf = (*clcfp)->loc_conf;
/* look up nested locations */