MCPcopy Create free account
hub / github.com/delinoio/oss / allowLocalProxy

Function allowLocalProxy

apps/async-commit-hook/src/dev-proxy.ts:2–13  ·  view source on GitHub ↗
(request: {
  method?: string;
  headers: Record<string, string | string[] | undefined>;
})

Source from the content-addressed store, hash-verified

1// The development proxy must not turn cross-origin traffic into trusted RPCs.
2export function allowLocalProxy(request: {
3 method?: string;
4 headers: Record<string, string | string[] | undefined>;
5}): boolean {
6 const host = request.headers.host;
7 return (
8 (host === "localhost:46308" || host === "127.0.0.1:46308") &&
9 request.headers.origin === `http://${host}` &&
10 request.method === "POST" &&
11 request.headers["x-ach-api-version"] === "1"
12 );
13}

Callers 2

bypassFunction · 0.90
dev-proxy.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected