Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Commit

Permalink
catch invalid regex
Browse files Browse the repository at this point in the history
  • Loading branch information
kspearrin committed May 31, 2018
1 parent 2c43a5f commit e0190f1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/services/cipher.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,12 @@ export class CipherService implements CipherServiceAbstraction {
}
break;
case UriMatchType.RegularExpression:
const regex = new RegExp(u.uri, 'i');
if (regex.test(url)) {
return true;
}
try {
const regex = new RegExp(u.uri, 'i');
if (regex.test(url)) {
return true;
}
} catch { }
break;
case UriMatchType.Never:
default:
Expand Down

0 comments on commit e0190f1

Please sign in to comment.