]> git.kaiwu.me - nginx.git/commitdiff
Fixed the "include" directive inside the "geo" block.
authorEugene Grebenschikov <e.grebenshchikov@f5.com>
Thu, 12 Mar 2026 00:57:05 +0000 (17:57 -0700)
committerEugene <54681898+jimf5@users.noreply.github.com>
Tue, 24 Mar 2026 18:20:16 +0000 (11:20 -0700)
The "include" directive should be able to include multiple files if
given a filename mask.

Completes remaining changes introduced in da4ffd8.

Closes: https://github.com/nginx/nginx/issues/1165
src/http/modules/ngx_http_geo_module.c
src/stream/ngx_stream_geo_module.c

index 619a5fde81064c91ead487727ee8c1f3600f924f..5018e1abb572b7e636c42b368dea1b491357a49f 100644 (file)
@@ -645,7 +645,12 @@ ngx_http_geo(ngx_conf_t *cf, ngx_command_t *dummy, void *conf)
 
     if (ngx_strcmp(value[0].data, "include") == 0) {
 
-        rv = ngx_http_geo_include(cf, ctx, &value[1]);
+        if (strpbrk((char *) value[1].data, "*?[") == NULL) {
+            rv = ngx_http_geo_include(cf, ctx, &value[1]);
+
+        } else {
+            rv = ngx_conf_include(cf, dummy, conf);
+        }
 
         goto done;
 
index c109dc72ed8737a65247e518bfda4eb8d057c445..316de92869d82c3a831548f2de923b34a46569ee 100644 (file)
@@ -605,7 +605,12 @@ ngx_stream_geo(ngx_conf_t *cf, ngx_command_t *dummy, void *conf)
 
     if (ngx_strcmp(value[0].data, "include") == 0) {
 
-        rv = ngx_stream_geo_include(cf, ctx, &value[1]);
+        if (strpbrk((char *) value[1].data, "*?[") == NULL) {
+            rv = ngx_stream_geo_include(cf, ctx, &value[1]);
+
+        } else {
+            rv = ngx_conf_include(cf, dummy, conf);
+        }
 
         goto done;
     }