diff --git a/lib/index.js b/lib/index.js index acf1cde68b31a9ecba9aff74db58c7f4537d7a29..e4d7101f63e66a63264944c9c9d57d54a1022ea4 100644 --- a/lib/index.js +++ b/lib/index.js @@ -535,7 +535,7 @@ const fetchHandler = new HostConnectionService(ctx, trustedHosts).createSharedFetchHandler(API_PATH, { async fetch(request) { const pathname = new URL(request.url).pathname; const method = pathname.startsWith(`/api/`) ? pathname.slice(5) : void 0; - if (method !== void 0 && PRIVILEGED_METHODS.has(method) && !isTrustedApiRequest(request, [])) return new Response("forbidden", { status: 403 }); + if (method !== void 0 && PRIVILEGED_METHODS.has(method) && !isTrustedApiRequest(request, trustedHosts)) return new Response("forbidden", { status: 403 }); if (request.method === "GET" && (pathname === MUX_EVENTS_PATH || pathname === HOST_EVENTS_PATH)) return new Response("upgrade required", { status: 426, headers: {