MCPcopy Create free account
hub / github.com/Effect-TS/effect / allowHeaders

Function allowHeaders

packages/effect/src/unstable/http/HttpMiddleware.ts:342–359  ·  view source on GitHub ↗
(
    accessControlRequestHeaders: string | undefined
  )

Source from the content-addressed store, hash-verified

340 : undefined
341
342 const allowHeaders = (
343 accessControlRequestHeaders: string | undefined
344 ): ReadonlyRecord<string, string> | undefined => {
345 if (opts.allowedHeaders.length === 0 && accessControlRequestHeaders) {
346 return {
347 vary: "Access-Control-Request-Headers",
348 "access-control-allow-headers": accessControlRequestHeaders
349 }
350 }
351
352 if (opts.allowedHeaders) {
353 return {
354 "access-control-allow-headers": opts.allowedHeaders.join(",")
355 }
356 }
357
358 return undefined
359 }
360
361 const exposeHeaders = opts.exposedHeaders.length > 0
362 ? { "access-control-expose-headers": opts.exposedHeaders.join(",") }

Callers 1

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected