Commit 47cedc30 authored by phriedrich's avatar phriedrich Committed by Diego Mello
Browse files

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


Co-authored-by: default avatarDiego Mello <diegolmello@gmail.com>
parent 06730814
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 };
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment