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

Function headersForUrl

apps/cli/src/device-login.ts:146–156  ·  view source on GitHub ↗
(
  url: string,
  baseHeaders: Record<string, string>,
  options: DeviceLoginHttpOptions = {},
)

Source from the content-addressed store, hash-verified

144};
145
146const headersForUrl = (
147 url: string,
148 baseHeaders: Record<string, string>,
149 options: DeviceLoginHttpOptions = {},
150): Record<string, string> => {
151 const configured =
152 options.headers && (!options.serverOrigin || isSameOrigin(url, options.serverOrigin))
153 ? options.headers
154 : {};
155 return { ...configured, ...baseHeaders };
156};
157
158const post = async (
159 url: string,

Callers 2

postFunction · 0.85
discoverCliLoginFunction · 0.85

Calls 1

isSameOriginFunction · 0.85

Tested by

no test coverage detected