From 0fe446ff79fd87eb56c5e4f48238b3c47634422f Mon Sep 17 00:00:00 2001 From: onefang Date: Mon, 30 Sep 2019 21:52:28 +1000 Subject: If only the protocol changed, just log and return. The other protocol will be tested later. --- mirror-checker.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mirror-checker.lua b/mirror-checker.lua index 074064c..b49c725 100755 --- a/mirror-checker.lua +++ b/mirror-checker.lua @@ -244,8 +244,10 @@ checkHEAD = function (host, URL, r, retry) end l = h.location if nil ~= l then - if testing("Protocol") and (pu.scheme ~= PU.scheme) then - W(" protocol changed during redirect! " .. check .. " " .. host .. " -> " .. URL .. " -> " .. l) + pu = url.parse(l, defaultURL) + if (pu.scheme ~= PU.scheme) then + if testing("Protocol") then W(" protocol changed during redirect! " .. check .. " " .. host .. " -> " .. URL .. " -> " .. l) end + if (pu.host == host) and pu.path == PU.path then D("Not testing protocol change " .. URL .. " -> " .. l); return end end if l == URL then -- cgit v1.1