diff --git a/ts/OS.ts b/ts/OS.ts index 4ae89178c..0f92f9d93 100644 --- a/ts/OS.ts +++ b/ts/OS.ts @@ -13,3 +13,5 @@ export const isWindows = (minVersion?: string) => { return _.isUndefined(minVersion) ? true : semver.gte(osRelease, minVersion); }; + +export const getOSArchitecture = () => os.arch(); diff --git a/ts/session/apis/file_server_api/FileServerApi.ts b/ts/session/apis/file_server_api/FileServerApi.ts index 3c3e27666..519bf2913 100644 --- a/ts/session/apis/file_server_api/FileServerApi.ts +++ b/ts/session/apis/file_server_api/FileServerApi.ts @@ -8,6 +8,7 @@ import { import { fromUInt8ArrayToBase64 } from '../../utils/String'; import { NetworkTime } from '../../../util/NetworkTime'; import { DURATION } from '../../constants'; +import { getOSArchitecture } from '../../../OS'; export const fileServerHost = 'filev2.getsession.org'; export const fileServerURL = `http://${fileServerHost}`; @@ -146,9 +147,11 @@ export const getLatestReleaseFromFileServer = async ( 'X-FS-Timestamp': `${sigTimestampSeconds}`, 'X-FS-Signature': fromUInt8ArrayToBase64(signature), }; + + const endpoint = `${RELEASE_VERSION_ENDPOINT}&arch=${getOSArchitecture()}`; const result = await OnionSending.sendJsonViaOnionV4ToFileServer({ abortSignal: new AbortController().signal, - endpoint: RELEASE_VERSION_ENDPOINT, + endpoint, method: 'GET', stringifiedBody: null, headers,