sdk(express): add user-agent as well
This commit is contained in:
@@ -26,6 +26,9 @@ export default function createMiddleware(options: OpenpanelOptions) {
|
|||||||
if (ip) {
|
if (ip) {
|
||||||
sdk.api.addHeader('x-client-ip', 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) {
|
if (options.getProfileId) {
|
||||||
const profileId = options.getProfileId(req);
|
const profileId = options.getProfileId(req);
|
||||||
|
|||||||
Reference in New Issue
Block a user