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

Function marketingProxyRequest

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

Source from the content-addressed store, hash-verified

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

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