Skip to content
This repository has been archived by the owner on Jun 7, 2019. It is now read-only.

Commit

Permalink
🌱 Add platform information to API client user agent
Browse files Browse the repository at this point in the history
  • Loading branch information
willclarktech committed Apr 24, 2018
1 parent 74a72f5 commit 5a6444c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/api_client/api_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* Removal or modification of this copyright notice is prohibited.
*
*/
import os from 'os';
import {
MAINNET_NETHASH,
TESTNET_NETHASH,
Expand All @@ -36,9 +37,17 @@ const defaultOptions = {
randomizeNode: true,
};

const locale =
process.env.LC_ALL ||
process.env.LC_MESSAGES ||
process.env.LANG ||
process.env.LANGUAGE;

const commonHeaders = {
'Content-Type': 'application/json',
'User-Agent': 'lisk-js/1.0',
'User-Agent': `LiskJS/1.0 (${os.platform()} ${os.release()}; ${os.arch()}${
locale ? `; ${locale}` : ''
})`,
};

export default class APIClient {
Expand Down

0 comments on commit 5a6444c

Please sign in to comment.