From 091213e61e8fe047cef022a3867afff1feb0c28c Mon Sep 17 00:00:00 2001 From: Christos Tsantilas Date: Tue, 24 Sep 2019 10:04:05 +0000 Subject: [PATCH] Bug 4987: restore support for the "cache_object://" URI scheme (#475) Broken by commit 6c880a1. --- src/anyp/Uri.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/anyp/Uri.cc b/src/anyp/Uri.cc index a8e49f1b19..e42f7c6c02 100644 --- a/src/anyp/Uri.cc +++ b/src/anyp/Uri.cc @@ -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)]) { -- 2.47.2