[FIX] Set the http-agent to the form that Rocket.Chat requires for logging (#1482)

Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
phriedrich 2020-01-28 14:24:29 +01:00 committed by Diego Mello
parent 0673081465
commit 47cedc3075
1 changed files with 2 additions and 1 deletions

View File

@ -1,7 +1,8 @@
import { Platform } from 'react-native';
import DeviceInfo from 'react-native-device-info';
export const headers = { 'User-Agent': `RC-RN Mobile/${ DeviceInfo.getVersion() } (build: ${ DeviceInfo.getBuildNumber() }; os: ${ Platform.OS } ${ DeviceInfo.getSystemVersion() })` };
// this form is required by Rocket.Chat's parser in "app/statistics/server/lib/UAParserCustom.js"
export const headers = { 'User-Agent': `RC Mobile; ${ Platform.OS } ${ DeviceInfo.getSystemVersion() }; v${ DeviceInfo.getVersion() } (${ DeviceInfo.getBuildNumber() })` };
export default (url, options = {}) => {
let customOptions = { ...options, headers };