From e2be67b17dfbfd8f8c2fe331906b7919da7fea2f Mon Sep 17 00:00:00 2001 From: Alex Rousskov Date: Fri, 12 Aug 2022 16:06:12 +0000 Subject: [PATCH] Do not tell admins that we are replacing their .* with our .* (#1119) acl hasHeaderFoo req_header Foo .* 2022/08/12 11:43:27| WARNING: regular expression '.*' has only wildcards and matches all strings. Using '.*' instead. Broken since RE optimization inception (commit 6564dae), but the excessive WARNING was "invisible" to many admins until 61be1d8 started saving early level-0/1 messages to cache.log. --- src/acl/RegexData.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/acl/RegexData.cc b/src/acl/RegexData.cc index f4e68926a0..08d4676509 100644 --- a/src/acl/RegexData.cc +++ b/src/acl/RegexData.cc @@ -79,6 +79,9 @@ ACLRegexData::dump() const static const char * removeUnnecessaryWildcards(char * t) { + if (strcmp(t, ".*") == 0) // we cannot simplify that further + return t; // avoid "WARNING: ... Using '.*' instead" below + char * orig = t; if (strncmp(t, "^.*", 3) == 0) -- 2.47.2