MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / marketingProxyRequest

Function marketingProxyRequest

apps/cloud/src/edge/marketing.ts:39–50  ·  view source on GitHub ↗
(request: Request)

Source from the content-addressed store, hash-verified

37 * Returns `null` when the cloud application owns the request instead.
38 */
39export const marketingProxyRequest = (request: Request): Request | null => {
40 const url = new URL(request.url);
41 if (url.hostname !== "executor.sh") return null;
42
43 const shouldProxy =
44 isMarketingPath(url.pathname) ||
45 (url.pathname === "/" && !parseCookie(request.headers.get("cookie"), SESSION_COOKIE));
46 if (!shouldProxy) return null;
47
48 if (url.pathname === "/home") url.pathname = "/";
49 return new Request(url, request);
50};

Callers 2

server.tsFile · 0.90
marketing.test.tsFile · 0.90

Calls 3

parseCookieFunction · 0.90
isMarketingPathFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected