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

Function getClientIp

apps/sim/lib/core/utils/request.ts:16–22  ·  view source on GitHub ↗
(request: { headers: { get(name: string): string | null } })

Source from the content-addressed store, hash-verified

14 * Extract the client IP from a request, checking `x-forwarded-for` then `x-real-ip`.
15 */
16export function getClientIp(request: { headers: { get(name: string): string | null } }): string {
17 return (
18 request.headers.get('x-forwarded-for')?.split(',')[0]?.trim() ||
19 request.headers.get('x-real-ip')?.trim() ||
20 'unknown'
21 )
22}
23
24/**
25 * No-operation function for use as default callback

Callers 15

handleSecurityFilteringFunction · 0.90
verifyCronAuthFunction · 0.90
validateDeploymentAuthFunction · 0.90
enforceIpRateLimitFunction · 0.90
sendToProfoundFunction · 0.90
verifyAuthFunction · 0.90
route.tsFile · 0.90
route.tsFile · 0.90
route.tsFile · 0.90
route.tsFile · 0.90
route.tsFile · 0.90

Calls 1

getMethod · 0.65

Tested by

no test coverage detected