Valentin V. Bartenev
September 04, 2023 03:14PM
# HG changeset patch
# User Valentin Bartenev <vbart@wbsrv.ru>
# Date 1693854233 -10800
# Mon Sep 04 22:03:53 2023 +0300
# Node ID c706913db63c6862c13a0a540cdc37be0ccf0c81
# Parent daf8f5ba23d8e9955b22782d945f9c065f4b6baa
Allowed nesting arbitrary prefix "location" in regex "location".

Previously, only prefix "location" blocks that literally matched the beginning
of the regular expression were allowed inside. This restriction makes no sense
because regular expressions have different matching semantics.

diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -3202,6 +3202,7 @@ ngx_http_core_location(ngx_conf_t *cf, n

#if (NGX_PCRE)
if (clcf->regex == NULL
+ && pclcf->regex == NULL
&& ngx_filename_cmp(clcf->name.data, pclcf->name.data, len) != 0)
#else
if (ngx_filename_cmp(clcf->name.data, pclcf->name.data, len) != 0)
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Allowed nesting arbitrary prefix "location" in regex "location"

Valentin V. Bartenev 202 September 04, 2023 03:14PM

Re: [PATCH] Allowed nesting arbitrary prefix "location" in regex "location"

Maxim Dounin 59 September 10, 2023 03:12PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 60
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready