summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlrike Uhlig <u@451f.org>2016-11-01 16:20:23 +0100
committerUlrike Uhlig <u@451f.org>2016-11-01 16:20:23 +0100
commit28709801a8294d9a025dcdf6e9af8cb2bd456225 (patch)
tree7782cb1fc7f133b93ea6d119870f2f6b9ea7118f
parent66bff5a44677abf2028bbd8f95457cffa3d54758 (diff)
Only return true value if tested URL matches active mirror's URL prefix.
If for some reason curDownload.source.url matches a disabled mirror's URL prefix, we need to avoid trying to continue the download using that disabled mirror.
-rw-r--r--tails-download-and-verify/lib/downloader.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/tails-download-and-verify/lib/downloader.js b/tails-download-and-verify/lib/downloader.js
index bb88b10..f9ee529 100644
--- a/tails-download-and-verify/lib/downloader.js
+++ b/tails-download-and-verify/lib/downloader.js
@@ -151,7 +151,7 @@ function compareUrlToMirrors(testurl, mirrors, url_suffix=blob.url_suffix) {
console.log("Tested URL to compare against mirrors: " + testurl);
for (let m_url = 0; m_url < mirrors.length; m_url++) {
console.log("Mirror URL to compare against " + mirrors.mirrors[m_url].url_prefix + url_suffix);
- if (mirrors.mirrors[m_url].url_prefix + url_suffix == testurl) {
+ if (mirrors.mirrors[m_url].url_prefix + url_suffix == testurl && mirrors.mirrors[m_url].weight > 0) {
console.log("Download URL corresponds to a known mirror URL: " + mirrors.mirrors[m_url].url_prefix);
return m_url; // just return the index.
}