Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-1477 Wildcard/Regex Whitelisting #501

Merged
merged 8 commits into from Mar 3, 2020

Check for truthy instead of not undefined

  • Loading branch information
benstrumeyer committed Feb 27, 2020
commit 7b5445f161871015956b09d2d8b4d404c95d12a4
@@ -187,7 +187,7 @@ class Policy {
* @return {boolean}
*/
matchesWildcard(url, pattern) {
if (typeof pattern !== 'undefined' && pattern.includes('*')) {
if (pattern && pattern.includes('*')) {
const wildcardPattern = pattern.replace(/\*/g, '.*');
try {
const wildcardRegex = new RegExp(wildcardPattern);
ProTip! Use n and p to navigate between commits in a pull request.