aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-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