diff --git a/app/rooms/[roomName]/PageClientImpl.tsx b/app/rooms/[roomName]/PageClientImpl.tsx index 465c50c..1bf4761 100644 --- a/app/rooms/[roomName]/PageClientImpl.tsx +++ b/app/rooms/[roomName]/PageClientImpl.tsx @@ -24,21 +24,10 @@ import { import { useRouter } from 'next/navigation'; import React from 'react'; -const DEFAULT_CONN_DETAILS_ENDPOINT = '/api/connection-details'; const CONN_DETAILS_ENDPOINT = - process.env.NEXT_PUBLIC_CONN_DETAILS_ENDPOINT ?? DEFAULT_CONN_DETAILS_ENDPOINT; + process.env.NEXT_PUBLIC_CONN_DETAILS_ENDPOINT ?? '/api/connection-details'; const SHOW_SETTINGS_MENU = process.env.NEXT_PUBLIC_SHOW_SETTINGS_MENU == 'true'; -function getConnectionDetailsHeaders(): HeadersInit | undefined { - const hostnameRegex = /^(?[a-z0-9][a-z0-9-]*[a-z0-9])(\.sandbox\.livekit\.io|\.sandbox\.staging\.livekit\.io)$/; - const match = window.location.hostname.match(hostnameRegex); - const sandbox_id = match?.groups?.sandbox_id; - if (!sandbox_id) { - return; - } - return { 'X-Sandbox-ID': sandbox_id }; -} - export function PageClientImpl(props: { roomName: string; region?: string; @@ -67,10 +56,7 @@ export function PageClientImpl(props: { if (props.region) { url.searchParams.append('region', props.region); } - const connectionDetailsResp = await fetch( - url.toString(), - { headers: getConnectionDetailsHeaders() }, - ); + const connectionDetailsResp = await fetch(url.toString()); const connectionDetailsData = await connectionDetailsResp.json(); setConnectionDetails(connectionDetailsData); }, []); @@ -140,9 +126,9 @@ function VideoConferenceComponent(props: { dynacast: true, e2ee: e2eeEnabled ? { - keyProvider, - worker, - } + keyProvider, + worker, + } : undefined, }; // @ts-ignore