-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(psl): Replaced psl module with tldts for up to date public suffix…
… list
- Loading branch information
Showing
7 changed files
with
92 additions
and
3,303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
'use strict'; | ||
|
||
const psl = require('psl'); | ||
const tldts = require('tldts'); | ||
const dns = require('node:dns').promises; | ||
|
||
const resolveTxt = async (domain, resolver) => { | ||
|
@@ -33,7 +33,7 @@ const getDmarcRecord = async (domain, resolver) => { | |
let isOrgRecord = false; | ||
|
||
if (!txt) { | ||
let orgDomain = psl.get(domain); | ||
let orgDomain = tldts.getDomain(domain); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
andris9
Author
Collaborator
|
||
if (orgDomain !== domain) { | ||
// try org domain as well | ||
txt = await resolveTxt(orgDomain, resolver); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Nit. By default the parsing of
tldts
does not take the "private" section of the public suffix list into account. If it's important for your use-case you might want to consider addingallowPrivateDomains
option.