From d6f7f77febcc48e6b001762eae76a3a4ce1dee43 Mon Sep 17 00:00:00 2001 From: Miodec Date: Tue, 28 Nov 2023 15:02:04 +0000 Subject: [PATCH] refactor: agent log ips can no longer be an array --- backend/src/utils/misc.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/utils/misc.ts b/backend/src/utils/misc.ts index d838ed3ab..b2f136b20 100644 --- a/backend/src/utils/misc.ts +++ b/backend/src/utils/misc.ts @@ -44,7 +44,7 @@ export function base64UrlDecode(data: string): string { } interface AgentLog { - ip: string | string[]; + ip: string; agent: string; device?: string; } @@ -54,8 +54,8 @@ export function buildAgentLog(req: MonkeyTypes.Request): AgentLog { const agentLog: AgentLog = { ip: - req.headers["cf-connecting-ip"] || - req.headers["x-forwarded-for"] || + (req.headers["cf-connecting-ip"] as string) || + (req.headers["x-forwarded-for"] as string) || req.ip || "255.255.255.255", agent: `${agent.os.name} ${agent.os.version} ${agent.browser.name} ${agent.browser.version}`,