24 })) as Record<string, "ALLOWED">
25 // https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url
26 const URLRegex =
27 /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/28 const appsWithMetadata = await Promise.all(
29 Object.keys(permissions)
30 .filter((key) => URLRegex.test(key))
24 })) as Record<string, "ALLOWED">
25 // https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url
26 const URLRegex =
27 /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/28 const appsWithMetadata = await Promise.all(
29 Object.keys(permissions)
30 .filter((key) => URLRegex.test(key))
Escaping non-special characters in strings, template literals, and regular expressions doesn't have any effect.
"\'";
'\"';
"\#";
"\e";
`\"`;
`\"${foo}\"`;
`\#{foo}`;
/\!/;
/\@/;
"\"";
'\'';
"\x12";
"\u00a9";
"\371";
"xs\u2111";
`\``;
`\${${foo}}`;
`$\{${foo}}`;
/\/g;
/\t/g;
/\w\$\*\^\./;