MCPcopy Index your code
hub / github.com/simstudioai/sim / getClientIp

Function getClientIp

packages/audit/src/log.ts:23–29  ·  view source on GitHub ↗
(request: { headers: { get(name: string): string | null } })

Source from the content-addressed store, hash-verified

21}
22
23function getClientIp(request: { headers: { get(name: string): string | null } }): string {
24 return (
25 request.headers.get('x-forwarded-for')?.split(',')[0]?.trim() ||
26 request.headers.get('x-real-ip')?.trim() ||
27 'unknown'
28 )
29}
30
31/**
32 * Fire-and-forget audit log write. Never throws; failures are logged.

Callers 1

insertAuditLogFunction · 0.70

Calls 1

getMethod · 0.65

Tested by

no test coverage detected