sdk(express): add user-agent as well

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-06-25 12:27:28 +02:00
parent 28f36da68e
commit 77cd74816c

View File

@@ -26,6 +26,9 @@ export default function createMiddleware(options: OpenpanelOptions) {
if (ip) {
sdk.api.addHeader('x-client-ip', ip);
}
if (req.headers['user-agent']) {
sdk.api.addHeader('x-user-agent', req.headers['user-agent'] as string);
}
if (options.getProfileId) {
const profileId = options.getProfileId(req);