]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Do not tell admins that we are replacing their .* with our .* (#1119)
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 12 Aug 2022 16:06:12 +0000 (16:06 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sun, 14 Aug 2022 16:06:56 +0000 (16:06 +0000)
    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

index f4e68926a056951c0cacd23254ecfc1c0ac70888..08d4676509640cee18a1c738ae7a760ddd43da64 100644 (file)
@@ -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)