fix: default to unknown user-agent

This commit is contained in:
Carl-Gerhard Lindesvärd
2026-02-09 12:04:55 +00:00
parent 6ce9b5dd1b
commit e129a53ce5

View File

@@ -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);