From 72d5175e6fd27cc9fb4712ce76f4696304add701 Mon Sep 17 00:00:00 2001 From: yougotwill Date: Tue, 11 Feb 2025 11:34:02 +1100 Subject: [PATCH] feat: include architecture in release version request --- ts/OS.ts | 2 ++ ts/session/apis/file_server_api/FileServerApi.ts | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) 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,