From 1c2b8061dcc4daaa15a7eea3a34412b256b3772b Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Thu, 22 May 2025 17:41:46 +0530 Subject: [PATCH] Include "X-Client-Version" where applicable --- web/packages/base/http.ts | 3 +++ web/packages/base/next.config.base.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/web/packages/base/http.ts b/web/packages/base/http.ts index 38bb447608..e21b6f97c6 100644 --- a/web/packages/base/http.ts +++ b/web/packages/base/http.ts @@ -1,3 +1,4 @@ +import { desktopAppVersion, isDesktop } from "ente-base/app"; import { wait } from "ente-utils/promise"; import { z } from "zod"; import { clientPackageName } from "./app"; @@ -14,6 +15,7 @@ import log from "./log"; export const authenticatedRequestHeaders = async () => ({ "X-Auth-Token": await ensureAuthToken(), "X-Client-Package": clientPackageName, + ...(isDesktop ? { "X-Client-Version": desktopAppVersion } : {}), }); /** @@ -25,6 +27,7 @@ export const authenticatedRequestHeaders = async () => ({ */ export const publicRequestHeaders = () => ({ "X-Client-Package": clientPackageName, + ...(isDesktop ? { "X-Client-Version": desktopAppVersion } : {}), }); /** diff --git a/web/packages/base/next.config.base.js b/web/packages/base/next.config.base.js index 5bb855f792..8afb699564 100644 --- a/web/packages/base/next.config.base.js +++ b/web/packages/base/next.config.base.js @@ -64,7 +64,7 @@ const isDesktop = process.env._ENTE_IS_DESKTOP ? "1" : ""; /** * When we're running within the desktop app, also extract the version of the - * desktop app for use in our "X-Client-Package" string. + * desktop app for use in our "X-Client-Version" string. * * > The web app has continuous deployments, and doesn't have versions. */