From e6542733d4bd88f64a71ed1baad03cf98cf819a3 Mon Sep 17 00:00:00 2001 From: onefang Date: Mon, 9 Dec 2019 09:24:40 +1000 Subject: Don't miscount some redirections as Protocol changes. --- apt-panopticon.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apt-panopticon.lua b/apt-panopticon.lua index db500e7..02d7d9e 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua @@ -521,7 +521,7 @@ checkHEAD = function (host, URL, r, retry, sanity) -- timeouts = timeouts - 1 -- Backoff the timeouts count if we managed to get through. if nil ~= location then pu = url.parse(location, defaultURL) - if (pu.scheme ~= PU.scheme) then + if ('http' == location:sub(1, 4)) and (pu.scheme ~= PU.scheme) then -- Sometimes a location sans scheme is returned, this is not a protocol change. if testing("Protocol") then W(" protocol changed during redirect! " .. check .. " " .. host .. " -> " .. URL .. " -> " .. location, PU.scheme, "Protocol", host) end if (pu.host == host) and pu.path == PU.path then D("Not testing protocol change " .. URL .. " -> " .. location); return end end -- cgit v1.1