Include "X-Client-Version" where applicable

This commit is contained in:
Manav Rathi
2025-05-22 17:41:46 +05:30
parent a9edcead06
commit 1c2b8061dc
2 changed files with 4 additions and 1 deletions

View File

@@ -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 } : {}),
});
/**

View File

@@ -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.
*/