]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4987: restore support for the "cache_object://" URI scheme (#475)
authorChristos Tsantilas <christos@chtsanti.net>
Tue, 24 Sep 2019 10:04:05 +0000 (10:04 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Thu, 26 Sep 2019 13:42:36 +0000 (13:42 +0000)
Broken by commit 6c880a1.

src/anyp/Uri.cc

index a8e49f1b193ca52eb3a63cd4704b516ce91a60b2..e42f7c6c022b2c4dff0d5dc42d54b4e10186a6d0 100644 (file)
@@ -142,8 +142,15 @@ uriParseScheme(Parser::Tokenizer &tok)
      * Scheme names consist of a sequence of characters beginning with a
      * letter and followed by any combination of letters, digits, plus
      * ("+"), period ("."), or hyphen ("-").
+     *
+     * The underscore ("_") required to match "cache_object://" squid
+     * special URI scheme.
      */
-    static const auto schemeChars = CharacterSet("scheme", "+.-") + CharacterSet::ALPHA + CharacterSet::DIGIT;
+    static const auto schemeChars =
+#if USE_HTTP_VIOLATIONS
+        CharacterSet("special", "_") +
+#endif
+        CharacterSet("scheme", "+.-") + CharacterSet::ALPHA + CharacterSet::DIGIT;
 
     SBuf str;
     if (tok.prefix(str, schemeChars, 16) && tok.skip(':') && CharacterSet::ALPHA[str.at(0)]) {