MCPcopy Create free account
hub / github.com/middleapi/orpc / toNodeHttpHeaders

Function toNodeHttpHeaders

packages/standard-server-node/src/headers.ts:4–15  ·  view source on GitHub ↗
(headers: StandardHeaders)

Source from the content-addressed store, hash-verified

2import type { OutgoingHttpHeaders } from 'node:http'
3
4export function toNodeHttpHeaders(headers: StandardHeaders): OutgoingHttpHeaders {
5 const nodeHttpHeaders: OutgoingHttpHeaders = {}
6
7 for (const [key, value] of Object.entries(headers)) {
8 // Node.js does not allow headers to be undefined
9 if (value !== undefined) {
10 nodeHttpHeaders[key] = value
11 }
12 }
13
14 return nodeHttpHeaders
15}

Callers 3

sendStandardResponseFunction · 0.90
headers.test.tsFile · 0.90
sendStandardResponseFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected