Skip to the content

Capsid menu

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

The functions of client-ip.ts
FunctionLinesComplexityCoveredCRAPMutation
clientIp5 to 72No data: no coverage report in this mapNo data: no coverage report in this mapNo 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";
}