Skip to content

Commit

Permalink
Use dashlane client agent header for requests
Browse files Browse the repository at this point in the history
Fix #200
  • Loading branch information
Mikescops committed Dec 6, 2023
1 parent 733ffde commit e56fc88
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/modules/api-connect/postRequestAPI.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import os from 'os';
import { signRequest } from './signRequest';
import { PostRequestAPIParams } from './types';
import { cliVersionToString, CLI_VERSION } from '../../cliVersion';

export const postRequestAPI = <T>(params: PostRequestAPIParams<T>) => {
const { path, authentication, payload, query, method, userAgent, requestFunction } = params;
Expand All @@ -9,6 +11,12 @@ export const postRequestAPI = <T>(params: PostRequestAPIParams<T>) => {
const forgedHeaders = {
'content-type': 'application/json',
'user-agent': userAgent || 'CI',
'dashlane-client-agent': JSON.stringify({
version: `${cliVersionToString(CLI_VERSION)}`,
platform: 'server_cli',
osversion: `${os.platform()}-${os.arch()}`,
partner: 'dashlane',
}),
host: 'api.dashlane.com',
};

Expand Down

0 comments on commit e56fc88

Please sign in to comment.