From e129a53ce5a3e831db0a490f94060392bf79d50c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carl-Gerhard=20Lindesva=CC=88rd?= Date: Mon, 9 Feb 2026 12:04:55 +0000 Subject: [PATCH] fix: default to unknown user-agent --- apps/api/src/controllers/track.controller.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/api/src/controllers/track.controller.ts b/apps/api/src/controllers/track.controller.ts index 61887395..2f6fbe7c 100644 --- a/apps/api/src/controllers/track.controller.ts +++ b/apps/api/src/controllers/track.controller.ts @@ -125,7 +125,8 @@ async function buildContext( validatedBody.type === 'track' && validatedBody.payload.properties?.__ip ? (validatedBody.payload.properties.__ip as string) : request.clientIp; - const ua = request.headers['user-agent']; + const ua = request.headers['user-agent'] ?? 'unknown/1.0'; + const headers = getStringHeaders(request.headers); const identity = getIdentity(validatedBody);