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

Function immutableHeaders

packages/effect/test/http/HttpServerResponse.test.ts:9–18  ·  view source on GitHub ↗
(response: Response)

Source from the content-addressed store, hash-verified

7
8// Bun leaves `Response.redirect` headers mutable, unlike Node, Deno and workerd
9const immutableHeaders = (response: Response): Response => {
10 for (const method of ["append", "set"]) {
11 Object.defineProperty(response.headers, method, {
12 value: () => {
13 throw new TypeError("immutable")
14 }
15 })
16 }
17 return response
18}
19
20describe("HttpServerResponse", () => {
21 describe("toWeb", () => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected