MCPcopy Index your code
hub / github.com/coder/code-server / getFirstHeader

Function getFirstHeader

src/node/http.ts:334–337  ·  view source on GitHub ↗
(req: http.IncomingMessage, headerName: string)

Source from the content-addressed store, hash-verified

332}
333
334function getFirstHeader(req: http.IncomingMessage, headerName: string): string | undefined {
335 const val = req.headers[headerName]
336 return Array.isArray(val) ? val[0] : val
337}
338
339/**
340 * Throw a forbidden error if origin checks fail. Call `next` if provided.

Callers 2

authenticateOriginFunction · 0.85
getHostFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected