]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4893: Malformed %>ru URIs for CONNECT requests (#299)
authorChristos Tsantilas <christos@chtsanti.net>
Thu, 4 Oct 2018 10:15:15 +0000 (10:15 +0000)
committerAmos Jeffries <yadij@users.noreply.github.com>
Sun, 14 Oct 2018 05:25:34 +0000 (18:25 +1300)
Commit bec110e (a.k.a. v4 commit fbbd5cd5) broke CONNECT URI logging
because it incorrectly assumed that URI::absolute() supports all URIs.
As the result, Squid logged CONNECT URLs as "://host:port".

Also fixed a similar wrong assumption in ACLFilledChecklist::verifyAle()
which may affect URL-related ACL checks for CONNECT requests, albeit
only in already buggy cases where Squid warns about "ALE missing URL".

This is a Measurement Factory project

src/AccessLogEntry.cc
src/acl/FilledChecklist.cc

index f3679256868fa9500c97002aa624cb049fe1b7cc..8476cb80feea9501a7fc0bbe8e146d798947dd0c 100644 (file)
@@ -115,7 +115,7 @@ AccessLogEntry::~AccessLogEntry()
 const SBuf *
 AccessLogEntry::effectiveVirginUrl() const
 {
-    const SBuf *effectiveUrl = request ? &request->url.absolute() : &virginUrlForMissingRequest_;
+    const SBuf *effectiveUrl = request ? &request->effectiveRequestUri() : &virginUrlForMissingRequest_;
     if (effectiveUrl && !effectiveUrl->isEmpty())
         return effectiveUrl;
     // We can not use ALE::url here because it may contain a request URI after
index 27c49a8111405f53c26761f1289264e6ed8a9647..63090847e2835cee6c95a6b96934cfd94378f8c8 100644 (file)
@@ -109,7 +109,7 @@ ACLFilledChecklist::verifyAle() const
             showDebugWarning("URL");
             // XXX: al->url should be the request URL from client,
             // but request->url may be different (e.g.,redirected)
-            al->url = request->url.absolute();
+            al->url = request->effectiveRequestUri();
         }
     }