app/lib/client-ip.ts
7 lines and 1 functions in DrDustinEdwards/dustinedwards-info, at commit 1590ba4 on 2026-10-24. This file on GitHub.
Functions
| Function | Lines | Complexity | Covered | CRAP | Mutation |
|---|---|---|---|---|---|
| clientIp | 5 to 7 | 2 | No data: no coverage report in this map | No data: no coverage report in this map | No data: no mutants in this code |
Imports
It imports no other module of this repo. Imported by app/routes/api.csp-report.ts, app/routes/api.health.ts, app/routes/preview.$token.tsx, app/routes/search.ask.ts, app/routes/webmention.ts.
Source
/**
* `cf-connecting-ip` is set by the edge and cannot be spoofed. The fallback fails closed: all
* header-less traffic shares one bucket rather than each caller minting a fresh identity.
*/
export function clientIp(request: Request): string {
return request.headers.get("cf-connecting-ip") ?? "unknown";
}