Skip to content

Commit afd583f

Browse files
committed
Update frameUrl() to use the sandbox host.
1 parent c2db6ab commit afd583f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/common/src/utils/url-generator.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,15 @@ export const frameUrl = (sandbox: Sandbox, append: string = '') => {
9999
return stagingFrameUrl(sandbox.id, path);
100100
}
101101

102-
return `${location.protocol}//${sandbox.id}.${host()}/${path}`;
102+
const sandboxHost = {
103+
'codesandbox.stream': 'codesandbox.dev',
104+
};
105+
106+
let sHost = host();
107+
if (sHost in sandboxHost) {
108+
sHost = sandboxHost[sHost];
109+
}
110+
return `${location.protocol}//${sandbox.id}.${sHost}/${path}`;
103111
};
104112

105113
export const forkSandboxUrl = (sandbox: Sandbox) =>

0 commit comments

Comments
 (0)