Skip to content

Commit

Permalink
useExternalAV: Improve the regex when finding the server address
Browse files Browse the repository at this point in the history
If the URL starts with `game.`, the original regex would catch the full
address and break the URL. Make it so we ignore `game` if it is after
`//`.
  • Loading branch information
bekriebel committed Jul 2, 2024
1 parent 3203211 commit aadf8ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/LiveKitClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,7 @@ export default class LiveKitClient {
}

sendJoinMessage(liveKitServer: string, accessToken: string) {
const foundryHost = window.location.href.replace(/\/game.*$/, "");
const foundryHost = window.location.href.replace(/(\/\/.*)\/game.*$/, "$1");
// Create the url for user to join the external LiveKit web client
const params = new URLSearchParams({
url: `wss://${liveKitServer}`,
Expand Down

0 comments on commit aadf8ee

Please sign in to comment.