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

Function shouldRewriteJavaScriptPath

packages/server/src/routes/previews.ts:242–257  ·  view source on GitHub ↗
(value: string, prefix: string)

Source from the content-addressed store, hash-verified

240 if (sameOrigin) {
241 return sameOriginPreviewSession(request.params.workspaceId, target);
242 }
243
244 const session = await previewRuntimeManager.acquire(
245 request.params.workspaceId,
246 target,
247 body.localHostname,
248 );
249 return await gatewaySessionResponse(session);
250 } catch (err) {
251 return errorResponse(err, reply);
252 }
253 });
254
255 app.post<{
256 Params: { workspaceId: string; sessionId: string };
257 }>('/api/previews/:workspaceId/sessions/:sessionId/heartbeat', async (request, reply) => {
258 try {
259 if (request.params.sessionId === SAME_ORIGIN_PREVIEW_SESSION_ID) {
260 const target = await previewService.getTarget(request.params.workspaceId);

Callers 1

Calls 3

getPathnameFunction · 0.85
hasStaticFileExtensionFunction · 0.85
isSameOrChildPathFunction · 0.70

Tested by

no test coverage detected