aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authoronefang2019-09-30 21:51:45 +1000
committeronefang2019-09-30 21:51:45 +1000
commit75c0a7bb7a2694405bba5f7a1f8ae7f51177f8f2 (patch)
treed911f7eec1e0cd785631b4a667f48c9f72cbf06e
parentCheck the original domain name as well as everything else. (diff)
downloadapt-panopticon-75c0a7bb7a2694405bba5f7a1f8ae7f51177f8f2.zip
apt-panopticon-75c0a7bb7a2694405bba5f7a1f8ae7f51177f8f2.tar.gz
apt-panopticon-75c0a7bb7a2694405bba5f7a1f8ae7f51177f8f2.tar.bz2
apt-panopticon-75c0a7bb7a2694405bba5f7a1f8ae7f51177f8f2.tar.xz
Oops, should have been part of te last commit.
-rwxr-xr-xmirror-checker.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/mirror-checker.lua b/mirror-checker.lua
index e3c6120..074064c 100755
--- a/mirror-checker.lua
+++ b/mirror-checker.lua
@@ -217,11 +217,13 @@ checkHEAD = function (host, URL, r, retry)
217 return 217 return
218 end 218 end
219 local PU = url.parse(URL, defaultURL) 219 local PU = url.parse(URL, defaultURL)
220 local pu = url.parse(PU.scheme .. "://" .. host, defaultURL)
220 D(PU.scheme .. " :// " .. check .. " " .. host .. " -> " .. URL) 221 D(PU.scheme .. " :// " .. check .. " " .. host .. " -> " .. URL)
221 if not testing(PU.scheme, host) then D("Not testing " .. PU.scheme .. " " .. host .. " -> " .. URL); return end 222 if not testing(PU.scheme, host) then D("Not testing " .. PU.scheme .. " " .. host .. " -> " .. URL); return end
222 -- TODO - Perhaps we should try it anyway, and mark it as a warning if it DOES work? 223 -- TODO - Perhaps we should try it anyway, and mark it as a warning if it DOES work?
223 if "https" == PU.scheme and "deb.devuan.org" == host then D("Not testing " .. PU.scheme .. " " .. host .. " -> " .. URL .. " mirrors shouldn't have the correct cert."); return end 224 if "https" == PU.scheme and "deb.devuan.org" == host then D("Not testing " .. PU.scheme .. " " .. host .. " -> " .. URL .. " mirrors shouldn't have the correct cert."); return end
224 local hd = {Host = host} 225 local hd = {}
226 if pu.host ~= PU.host then hd = {Host = host} end
225 local htp = http; 227 local htp = http;
226 if PU.scheme == "https" then htp = https end 228 if PU.scheme == "https" then htp = https end
227 -- NOTE - the docs for lua-sec say that redirect isn't supported is version 0.6, no idea if that means it ignores redirections like we want. 229 -- NOTE - the docs for lua-sec say that redirect isn't supported is version 0.6, no idea if that means it ignores redirections like we want.
@@ -242,7 +244,6 @@ checkHEAD = function (host, URL, r, retry)
242 end 244 end
243 l = h.location 245 l = h.location
244 if nil ~= l then 246 if nil ~= l then
245 local pu = url.parse(l, defaultURL)
246 if testing("Protocol") and (pu.scheme ~= PU.scheme) then 247 if testing("Protocol") and (pu.scheme ~= PU.scheme) then
247 W(" protocol changed during redirect! " .. check .. " " .. host .. " -> " .. URL .. " -> " .. l) 248 W(" protocol changed during redirect! " .. check .. " " .. host .. " -> " .. URL .. " -> " .. l)
248 end 249 end