Include "X-Client-Version" where applicable
This commit is contained in:
@@ -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 } : {}),
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user