mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 07:50:13 +00:00
fix(studio): a sealed preview's reload asks under one current frame token (#7862)
This commit is contained in:
@@ -218,6 +218,12 @@ describe("a host's sandbox origin", () => {
|
||||
`/api/projects/demo/preview/~${token}/comp/scene.html`,
|
||||
],
|
||||
["/api/projects/demo/preview?_t=1", `/api/projects/demo/preview/~${token}?_t=1`],
|
||||
// A reload starts from the frame's own src, which already carries a token, maybe a stale one.
|
||||
[`/api/projects/demo/preview/~${token}?_t=2`, `/api/projects/demo/preview/~${token}?_t=2`],
|
||||
[
|
||||
`/api/projects/demo/preview/~${"S".repeat(43)}/comp/scene.html`,
|
||||
`/api/projects/demo/preview/~${token}/comp/scene.html`,
|
||||
],
|
||||
])(
|
||||
"seals an opaque preview of %s and loads it under its project's frame token",
|
||||
async (directUrl, sealed) => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { studioApiFetch } from "../../utils/studioApiFetch";
|
||||
|
||||
const PREVIEW_PATH = /^(\/api\/projects\/[^/?#]+)\/preview(?=[/?#]|$)/;
|
||||
const PREVIEW_PATH = /^(\/api\/projects\/[^/?#]+)\/preview(?:\/~[\w-]{43})?(?=[/?#]|$)/;
|
||||
|
||||
export function fetchFrameToken(frameTokenPath: string): Promise<string | null> {
|
||||
return studioApiFetch(frameTokenPath)
|
||||
|
||||
Reference in New Issue
Block a user