MCPcopy Create free account
hub / github.com/simstudioai/sim / passThroughClientIp

Function passThroughClientIp

apps/sim/lib/core/rate-limiter/route-helpers.test.ts:25–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23})
24
25function passThroughClientIp() {
26 requestUtilsMockFns.mockGetClientIp.mockImplementation(
27 (req: { headers: { get(name: string): string | null } }) =>
28 req.headers.get('x-forwarded-for')?.split(',')[0]?.trim() ||
29 req.headers.get('x-real-ip')?.trim() ||
30 'unknown'
31 )
32}
33
34import { enforceIpRateLimit, enforceUserOrIpRateLimit, enforceUserRateLimit } from './route-helpers'
35

Callers 1

Calls 1

getMethod · 0.65

Tested by

no test coverage detected