]> git.kaiwu.me - nginx.git/commitdiff
Index: fixed handling of non-cacheable variables.
authorMaxim Dounin <mdounin@mdounin.ru>
Sat, 18 Jul 2026 16:45:55 +0000 (19:45 +0300)
committerRoman Arutyunyan <arutyunyan.roman@gmail.com>
Thu, 5 Nov 2026 15:50:02 +0000 (19:50 +0400)
Previously, "e.flushed = 1;" was incorrectly used during initial length
calculations, and as a result non-cacheable variables were not flushed.
The fix is to only set "e.flushed" when evaluating values.

A similar issue in try_files was fixed in 2424:46d11bff21ef (0.7.29).

Origin: <https://freenginx.org/hg/nginx/rev/511b31fbc525>
Signed-off-by: Roman Arutyunyan <arut@nginx.com>
src/http/modules/ngx_http_index_module.c

index 149b44725247414a7e975f3481974cf1d1a44ae4..9cb16ebc0299de89f14ba1d10b3bfd325640ba84 100644 (file)
@@ -145,7 +145,6 @@ ngx_http_index_handler(ngx_http_request_t *r)
 
             e.ip = index[i].lengths->elts;
             e.request = r;
-            e.flushed = 1;
 
             /* 1 is for terminating '\0' as in static names */
             len = 1;
@@ -182,6 +181,7 @@ ngx_http_index_handler(ngx_http_request_t *r)
             e.ip = index[i].values->elts;
             e.pos = name;
             e.end = name + allocated;
+            e.flushed = 1;
 
             while (*(uintptr_t *) e.ip) {
                 code = *(ngx_http_script_code_pt *) e.ip;