MCPcopy
hub / github.com/tinyhttp/tinyhttp / proxyaddr

Function proxyaddr

packages/proxy-addr/src/index.ts:133–140  ·  view source on GitHub ↗
(
  req: Pick<IncomingMessage, 'headers' | 'connection'>,
  trust: ((...args: any[]) => any) | any[] | string[] | string
)

Source from the content-addressed store, hash-verified

131 * @public
132 */
133export function proxyaddr(
134 req: Pick<IncomingMessage, 'headers' | 'connection'>,
135 trust: ((...args: any[]) => any) | any[] | string[] | string
136) {
137 const addrs = alladdrs(req, trust)
138
139 return addrs[addrs.length - 1]
140}
141/**
142 * Static trust function to trust nothing.
143 *

Callers 1

proxy-addr.test.tsFile · 0.90

Calls 1

alladdrsFunction · 0.85

Tested by

no test coverage detected