Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FXVPN-344: Add suffix list, update script, and refactor getTopLevelDomain #184

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lesleyjanenorton
Copy link
Member

This PR:

  • Adds scripts/updateSuffixRules.js which parses the list of known suffixes at https://publicsuffix.org/list/effective_tld_names.dat' and writes them to src/shared/suffixes.js.
  • Adds src/shared/suffixes.js with the latest suffix rules
  • Refactors getTopLevelDomain() to check against the list of known suffixes

try {
// Create a URL object from the input URL
let parsedUrl = new URL(url);
getDomainName(url) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NITPICKING: this is technically now an eTLD ("effective top-level domain").

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants