Skip to content

Commit

Permalink
fixed filter for encoded url
Browse files Browse the repository at this point in the history
  • Loading branch information
cenfun committed Dec 7, 2024
1 parent c99a6bf commit 4082014
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/utils/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,24 +175,24 @@ const Util = {
str = `${str}`;
pattern = `${pattern}`;

// mini match
if (minimatch(str, pattern)) {
// includes first
if (str.includes(pattern)) {
return true;
}

// includes
if (str.includes(pattern)) {
// with minimatch
if (minimatch(str, pattern)) {
return true;
}

// try decode url
// after decode url
str = decodeURIComponent(str);

if (minimatch(str, pattern)) {
if (str.includes(pattern)) {
return true;
}

if (str.includes(pattern)) {
if (minimatch(str, pattern)) {
return true;
}

Expand Down

0 comments on commit 4082014

Please sign in to comment.