Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
+2
-9
@@ -1,4 +1,5 @@
|
||||
import { AsyncLocalStorage } from "node:async_hooks";
|
||||
import { getTrustedClientIpOrNull } from "~/utils/server/IpUtils";
|
||||
|
||||
/**
|
||||
* Phase 10 Task #67 — Audit auto-capture (React-Router web).
|
||||
@@ -23,16 +24,8 @@ export type WebAuditContext = {
|
||||
|
||||
const webAuditContextStore = new AsyncLocalStorage<WebAuditContext>();
|
||||
|
||||
const FORWARDED_HEADERS = ["cf-connecting-ip", "x-real-ip", "x-forwarded-for"] as const;
|
||||
|
||||
export function extractWebActorIp(request: Request): string | null {
|
||||
for (const name of FORWARDED_HEADERS) {
|
||||
const raw = request.headers.get(name);
|
||||
if (typeof raw !== "string") continue;
|
||||
const first = raw.split(",")[0]?.trim();
|
||||
if (first && first.length > 0 && first.length <= 64) return first;
|
||||
}
|
||||
return null;
|
||||
return getTrustedClientIpOrNull(request);
|
||||
}
|
||||
|
||||
export function extractWebActorUserAgent(request: Request): string | null {
|
||||
|
||||
Reference in new issue
Block a user