Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Use API version for communicating app version with API instead of full version (#1274)
Leendert de Borst37c09c2c55c6
diff --git a/apps/browser-extension/src/utils/WebApiService.ts b/apps/browser-extension/src/utils/WebApiService.tsindex bc7ef24ab..79575c3ea 100644--- a/apps/browser-extension/src/utils/WebApiService.ts+++ b/apps/browser-extension/src/utils/WebApiService.ts@@ -103,8 +103,8 @@ export class WebApiService {const url = baseUrl + endpoint;const headers = new Headers(options.headers ?? {});- // Add client version header- headers.set('X-AliasVault-Client', `${AppInfo.CLIENT_NAME}-${AppInfo.VERSION}`);+ // Add client version header (using API_VERSION for server compatibility)+ headers.set('X-AliasVault-Client', `${AppInfo.CLIENT_NAME}-${AppInfo.API_VERSION}`);const requestOptions: RequestInit = {...options,diff --git a/apps/mobile-app/utils/AppInfo.ts b/apps/mobile-app/utils/AppInfo.tsindex 1aa6409ef..fbb38d445 100644--- a/apps/mobile-app/utils/AppInfo.ts+++ b/apps/mobile-app/utils/AppInfo.ts@@ -10,6 +10,14 @@ export class AppInfo {*/public static readonly VERSION = '0.24.0-alpha';+ /**+ * The API version to send to the server (base semver without stage suffixes).+ * Apple app store requires semver format without stage suffixes.+ */+ public static readonly API_VERSION = (() => {+ return AppInfo.VERSION.split('-')[0];+ })();+/*** The minimum supported AliasVault server (API) version. If the server version is below this, the* client will throw an error stating that the server should be updated.diff --git a/apps/mobile-app/utils/WebApiService.ts b/apps/mobile-app/utils/WebApiService.tsindex d98dc1998..f82d225ec 100644--- a/apps/mobile-app/utils/WebApiService.ts+++ b/apps/mobile-app/utils/WebApiService.ts@@ -112,8 +112,8 @@ export class WebApiService {const url = baseUrl + endpoint;const headers = new Headers(options.headers ?? {});- // Add client version header- headers.set('X-AliasVault-Client', `${AppInfo.CLIENT_NAME}-${AppInfo.VERSION}`);+ // Add client version header (using API_VERSION for server compatibility)+ headers.set('X-AliasVault-Client', `${AppInfo.CLIENT_NAME}-${AppInfo.API_VERSION}`);const requestOptions: RequestInit = {...options,