Skip to content

Commit 8b36446

Browse files
committed
Include ftp:// URLs in non-secure domain matching.
1 parent f405526 commit 8b36446

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/bg/ChildPolicies.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,15 @@
9292
patterns.map(p => p.replace(rx, (m, host) => tld.isIp(host) ? m : m + ".")
9393
).filter(validMatchPattern)
9494
);
95-
}
95+
};
96+
97+
let extraProtocols = patterns => patterns.concat(
98+
patterns.filter(p => p.startsWith("*://"))
99+
.map(p => p.replace("*", "ftp")));
96100

97101
let siteKeys2MatchPatterns = keys =>
98102
keys ? [... new Set(
99-
withFQDNs(flatten(keys.map(siteKey2MatchPattern)).filter(p => !!p)))]
103+
extraProtocols(withFQDNs(flatten(keys.map(siteKey2MatchPattern)).filter(p => !!p))))]
100104
: [];
101105

102106
var ChildPolicies = {

0 commit comments

Comments
 (0)