diff --git a/src/bootstrap.ts b/src/bootstrap.ts index 84d3d90b..6688a4f0 100644 --- a/src/bootstrap.ts +++ b/src/bootstrap.ts @@ -37,7 +37,12 @@ export async function bootstrap() { Origin ? { origin: (origin, callback) => { - const currentHost = new URL(origin).host + let currentHost: string + try { + currentHost = new URL(origin).host + } catch { + currentHost = origin + } const allow = Origin.some((host) => wcmatch(host)(currentHost)) callback(null, allow)