mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-27 17:27:32 +08:00
refactor: agent log ips can no longer be an array
This commit is contained in:
parent
0bbfbb48a3
commit
d6f7f77feb
1 changed files with 3 additions and 3 deletions
|
|
@ -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}`,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue