Skip to content

Commit c4eb243

Browse files
committed
fix: previous regex is better
1 parent 8a7af20 commit c4eb243

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/WebViewShared.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const defaultDeeplinkWhitelist = ['https:'] as const;
2020
const defaultDeeplinkBlocklist = [`http:`, `file:`, `javascript:`] as const;
2121

2222
const stringWhitelistToRegex = (originWhitelist: string): RegExp =>
23-
new RegExp(escapeStringRegexp(originWhitelist).replace(/^(https?:\/\/|mailto:).*/, '^$1.*$'));
23+
new RegExp(`^${escapeStringRegexp(originWhitelist).replace(/\\\*/g, '.*')}$`)
2424

2525
const matchWithRegexList = (
2626
compiledRegexList: readonly RegExp[],

0 commit comments

Comments
 (0)