From 957b7481d826f477a76947b17793989087fab8ab Mon Sep 17 00:00:00 2001 From: yan Date: Wed, 26 Oct 2016 14:16:36 -0700 Subject: [PATCH] filter out non-http(s) urls in https everywhere There is no need to check redirect loops unless a URL is http or https. Auditors: @bbondy Test Plan: n/a --- app/httpsEverywhere.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/httpsEverywhere.js b/app/httpsEverywhere.js index 4a503ff8939..ecba6d22d26 100644 --- a/app/httpsEverywhere.js +++ b/app/httpsEverywhere.js @@ -142,6 +142,10 @@ function onBeforeRedirect (details) { if (!mainFrameUrl || !Filtering.isResourceEnabled(module.exports.resourceName, mainFrameUrl)) { return } + // Ignore URLs that are not HTTP + if (!['http:', 'https:'].includes(urlParse(details.url).protocol)) { + return + } var canonicalUrl = canonicalizeUrl(details.url)