catch invalid regex

This commit is contained in:
Kyle Spearrin 2018-05-30 23:19:12 -04:00
parent 2c43a5f06a
commit e0190f14be
1 changed files with 6 additions and 4 deletions

View File

@ -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: