From 47cedc307527bf27d0e11cd8fc5866ffd2e1e3d7 Mon Sep 17 00:00:00 2001 From: phriedrich Date: Tue, 28 Jan 2020 14:24:29 +0100 Subject: [PATCH] [FIX] Set the http-agent to the form that Rocket.Chat requires for logging (#1482) Co-authored-by: Diego Mello --- app/utils/fetch.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/utils/fetch.js b/app/utils/fetch.js index 1e526af2..ec80dd02 100644 --- a/app/utils/fetch.js +++ b/app/utils/fetch.js @@ -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 };