MCPcopy Create free account
hub / github.com/agent-tower/core / buildPreviewPathPrefix

Function buildPreviewPathPrefix

packages/server/src/utils/preview-path.ts:12–16  ·  view source on GitHub ↗
(workspaceId: string, previewToken?: string | null)

Source from the content-addressed store, hash-verified

10}
11
12export function buildPreviewPathPrefix(workspaceId: string, previewToken?: string | null): string {
13 const encodedWorkspaceId = encodeURIComponent(workspaceId);
14 if (!previewToken) return `${PREVIEW_PREFIX}/${encodedWorkspaceId}`;
15 return `${PREVIEW_PREFIX}/${encodedWorkspaceId}/${PREVIEW_ACCESS_TOKEN_MARKER}/${encodeURIComponent(previewToken)}`;
16}
17
18function isPreviewAccessTokenSegment(segment: string): boolean {
19 return segment.startsWith(`${PREVIEW_ACCESS_TOKEN_VERSION}.`);

Callers 6

rewriteLocationHeaderFunction · 0.85
rewriteSetCookieHeaderFunction · 0.85
rewritePreviewBodyFunction · 0.85
previewRoutesFunction · 0.85
handlerFunction · 0.85
previews.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected