trust localhost for CI and devbuil
This commit is contained in:
@@ -19,18 +19,18 @@ export function calculateInitialMuteState(
|
|||||||
urlParams: Pick<UrlParams, "skipLobby" | "callIntent">,
|
urlParams: Pick<UrlParams, "skipLobby" | "callIntent">,
|
||||||
packageType: "full" | "embedded",
|
packageType: "full" | "embedded",
|
||||||
hostname: string | undefined = undefined,
|
hostname: string | undefined = undefined,
|
||||||
isDevBuild: boolean = import.meta.env.DEV,
|
trustLocalhost: boolean = import.meta.env.DEV || !!process.env.CI,
|
||||||
): { audioEnabled: boolean; videoEnabled: boolean } {
|
): { audioEnabled: boolean; videoEnabled: boolean } {
|
||||||
const { skipLobby, callIntent } = urlParams;
|
const { skipLobby, callIntent } = urlParams;
|
||||||
|
|
||||||
logger.debug(
|
logger.debug(
|
||||||
`calculateInitialMuteState: skipLobby=${skipLobby}, callIntent=${callIntent}, hostname=${hostname}, isDevBuild=${isDevBuild}`,
|
`calculateInitialMuteState: skipLobby=${skipLobby}, callIntent=${callIntent}, hostname=${hostname}, isDevBuild=${trustLocalhost}`,
|
||||||
);
|
);
|
||||||
|
|
||||||
const isTrustedHost =
|
const isTrustedHost =
|
||||||
packageType == "embedded" ||
|
packageType == "embedded" ||
|
||||||
// Trust local hosts in dev mode to make local testing easier
|
// Trust local hosts in dev mode to make local testing easier
|
||||||
(hostname == "localhost" && isDevBuild);
|
(hostname == "localhost" && trustLocalhost);
|
||||||
|
|
||||||
if (skipLobby && !isTrustedHost) {
|
if (skipLobby && !isTrustedHost) {
|
||||||
// If host not trusted and lobby skipped, default to muted to protect user privacy.
|
// If host not trusted and lobby skipped, default to muted to protect user privacy.
|
||||||
|
|||||||
Reference in New Issue
Block a user