Handle predicate location variable error
Some checks are pending
buildbot / buildbot (push) Waiting to run

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 2026-09-09 17:32:34 +04:00 • committed by Roman Arutyunyan
parent 5c812c034e
commit 005f9f5d4d

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 */