From f316a326cfa315918ac6c735072ce1eeec84e536 Mon Sep 17 00:00:00 2001 From: Manish Jethani Date: Sat, 4 Sep 2021 18:14:26 +0530 Subject: [PATCH] Use native Punycode conversion (#3854) --- platform/nodejs/index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/platform/nodejs/index.js b/platform/nodejs/index.js index e7182efef..b6b379995 100644 --- a/platform/nodejs/index.js +++ b/platform/nodejs/index.js @@ -29,11 +29,10 @@ import { createRequire } from 'module'; import { readFileSync } from 'fs'; import { dirname, resolve } from 'path'; -import { fileURLToPath } from 'url'; +import { domainToASCII, fileURLToPath } from 'url'; const __dirname = dirname(fileURLToPath(import.meta.url)); -import punycode from './lib/punycode.js'; import publicSuffixList from './lib/publicsuffixlist/publicsuffixlist.js'; import snfe from './js/static-net-filtering.js'; @@ -76,7 +75,7 @@ async function enableWASM() { function pslInit(raw) { if ( typeof raw === 'string' && raw.trim() !== '' ) { - publicSuffixList.parse(raw, punycode.toASCII); + publicSuffixList.parse(raw, domainToASCII); return publicSuffixList; } @@ -104,7 +103,7 @@ function pslInit(raw) { console.error('Unable to populate public suffix list'); return; } - publicSuffixList.parse(raw, punycode.toASCII); + publicSuffixList.parse(raw, domainToASCII); return publicSuffixList; }