瀏覽代碼

Fix: properly build internal cdn rules

SukkaW 2 年之前
父節點
當前提交
9a6ba02d3e
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      Build/build-internal-cdn-rules.js

+ 3 - 3
Build/build-internal-cdn-rules.js

@@ -8,7 +8,7 @@ const { createDomainSorter } = require('./lib/stable-sort-domain');
 const { task } = require('./lib/trace-runner');
 const { task } = require('./lib/trace-runner');
 const { compareAndWriteFile } = require('./lib/create-file');
 const { compareAndWriteFile } = require('./lib/create-file');
 const { getGorhillPublicSuffixPromise } = require('./lib/get-gorhill-publicsuffix');
 const { getGorhillPublicSuffixPromise } = require('./lib/get-gorhill-publicsuffix');
-const { createCachedGorhillGetDomain } = require('./lib/cached-tld-parse');
+// const { createCachedGorhillGetDomain } = require('./lib/cached-tld-parse');
 
 
 const escapeRegExp = (string = '') => string.replaceAll(/[$()*+.?[\\\]^{|}]/g, '\\$&');
 const escapeRegExp = (string = '') => string.replaceAll(/[$()*+.?[\\\]^{|}]/g, '\\$&');
 
 
@@ -17,14 +17,14 @@ const buildInternalCDNDomains = task(__filename, async () => {
   const keywords = new Set();
   const keywords = new Set();
 
 
   const gorhill = await getGorhillPublicSuffixPromise();
   const gorhill = await getGorhillPublicSuffixPromise();
-  const getDomain = createCachedGorhillGetDomain(gorhill);
   const domainSorter = createDomainSorter(gorhill);
   const domainSorter = createDomainSorter(gorhill);
 
 
   /**
   /**
    * @param {string} input
    * @param {string} input
    */
    */
   const addApexDomain = (input) => {
   const addApexDomain = (input) => {
-    const d = getDomain(input);
+    // We are including the private domains themselves
+    const d = tldts.getDomain(input, { allowPrivateDomains: false });
     if (d) {
     if (d) {
       set.add(d);
       set.add(d);
     }
     }