Skip to content

Commit c8fbfef

Browse files
authored
Merge pull request #163 from bsyk/normalizeDomain_patch
Fix stripping of @@|| in allowlists
2 parents e6d2b68 + f03e0ec commit c8fbfef

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/helpers.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,13 @@ export const requestGateway = (path, options) =>
7676
* @returns {string}
7777
*/
7878
export const normalizeDomain = (value, isAllowlisting) => {
79-
const normalized = value
79+
const init = (isAllowlisting) ? value.replace("@@||", "") : value;
80+
const normalized = init
8081
.replace(/(0\.0\.0\.0|127\.0\.0\.1|::1|::)\s+/, "")
8182
.replace("||", "")
8283
.replace("^$important", "")
8384
.replace("*.", "")
8485
.replace("^", "");
8586

86-
if (isAllowlisting) return normalized.replace("@@||", "");
87-
8887
return normalized;
8988
};

0 commit comments

Comments
 (0)