Skip to content

Commit

Permalink
Use native Punycode conversion (gorhill#3854)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjethani authored Sep 4, 2021
1 parent 4305376 commit f316a32
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions platform/nodejs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit f316a32

Please sign in to comment.