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

Function withoutConnectionHeaders

packages/platform/node/src/NodeHttpServer.ts:1148–1159  ·  view source on GitHub ↗
(
  headers: Record<string, string | Array<string>>
)

Source from the content-addressed store, hash-verified

1146])
1147
1148const withoutConnectionHeaders = (
1149 headers: Record<string, string | Array<string>>
1150): Record<string, string | Array<string>> => {
1151 let result: Record<string, string | Array<string>> | undefined
1152 for (const name in headers) {
1153 if (connectionHeaders.has(name) || (name === "te" && headers[name] !== "trailers")) {
1154 result ??= { ...headers }
1155 delete result[name]
1156 }
1157 }
1158 return result ?? headers
1159}
1160
1161// Unread request body discarded after the response to keep the connection alive. Past this it closes.
1162const maxDrainBytes = 256 * 1024

Callers 1

writeHeadFunction · 0.85

Calls 1

hasMethod · 0.65

Tested by

no test coverage detected