Remove *.fleek.co domains (#1475)

* Remove *.fleek.co domains

* Also add to additions

* Wildcard matching
This commit is contained in:
Jaco
2022-04-20 20:50:00 +02:00
committed by GitHub
parent 30a1c971c0
commit 969a67863e
2 changed files with 11 additions and 3 deletions
-2
View File
@@ -5336,8 +5336,6 @@
"startofficial.net",
"stepn.plus",
"stepns.pro",
"storageapi.fleek.co",
"storageapi2.fleek.co",
"stratos.medium.cn.com",
"stratos.medium.com.ru",
"stratos.polkastarter.com.es",
+11 -1
View File
@@ -10,6 +10,10 @@ const allowed = JSON.parse(fs.readFileSync('known.json', 'utf-8')) as Record<str
const all = JSON.parse(fs.readFileSync('all.json', 'utf8')) as { allow: string[]; deny: string[] };
const TOP_LEVEL = [
// wildcards
'*.fleek.co', // storageapi.fleek.co, storageapi2.fleek.co
// root domains
'ddns.net',
'herokuapp.com',
'hopto.org',
@@ -64,7 +68,13 @@ describe('added addresses', (): void => {
describe('added urls', (): void => {
it('has no entries for allowed top-level domains', (): void => {
const invalids = all.deny.filter((u) => TOP_LEVEL.includes(u));
const invalids = all.deny.filter((u) =>
TOP_LEVEL.some((t) =>
t.startsWith('*.')
? (u.endsWith(t.substring(1)) || u === t.substring(2))
: u === t
)
);
expect(invalids).toEqual([]);
});