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

Function request

e2e/src/workspace-write-permissions.ts:51–68  ·  view source on GitHub ↗
(
  target: TargetShape,
  identity: Identity,
  method: string,
  path: string,
  body?: unknown,
)

Source from the content-addressed store, hash-verified

49});
50
51const request = (
52 target: TargetShape,
53 identity: Identity,
54 method: string,
55 path: string,
56 body?: unknown,
57): Effect.Effect<Response> =>
58 Effect.promise(() =>
59 fetch(new URL(path, target.baseUrl), {
60 method,
61 headers: {
62 ...(identity.headers ?? {}),
63 origin: new URL(target.baseUrl).origin,
64 ...(body === undefined ? {} : { "content-type": "application/json" }),
65 },
66 ...(body === undefined ? {} : { body: JSON.stringify(body) }),
67 }),
68 );
69
70const expectForbidden = (
71 target: TargetShape,

Callers 1

expectForbiddenFunction · 0.70

Calls 1

fetchFunction · 0.50

Tested by

no test coverage detected