diff --git a/backend/src/api/controllers/result.ts b/backend/src/api/controllers/result.ts index 16e1c31d1..dae2d43e4 100644 --- a/backend/src/api/controllers/result.ts +++ b/backend/src/api/controllers/result.ts @@ -212,7 +212,8 @@ export async function addResult( if ( !validateResult( result, - req.headers["client-version"] as string, + (req.headers["x-client-version"] || + req.headers["client-version"]) as string, JSON.stringify(new UAParser(req.headers["user-agent"]).getResult()), user.lbOptOut === true ) diff --git a/backend/src/api/routes/index.ts b/backend/src/api/routes/index.ts index bca77442d..30e6e2963 100644 --- a/backend/src/api/routes/index.ts +++ b/backend/src/api/routes/index.ts @@ -66,7 +66,8 @@ function addApiRoutes(app: Application): void { } if (req.path === "/psas") { - const clientVersion = req.headers["client-version"]; + const clientVersion = + req.headers["x-client-version"] || req.headers["client-version"]; recordClientVersion(clientVersion?.toString() ?? "unknown"); } diff --git a/frontend/src/ts/ape/endpoints/psas.ts b/frontend/src/ts/ape/endpoints/psas.ts index 9e8065bd5..c97706fa2 100644 --- a/frontend/src/ts/ape/endpoints/psas.ts +++ b/frontend/src/ts/ape/endpoints/psas.ts @@ -1,5 +1,3 @@ -import { CLIENT_VERSION } from "../../version"; - const BASE_PATH = "/psas"; export default class Psas { @@ -8,10 +6,6 @@ export default class Psas { } async get(): Ape.EndpointData { - return await this.httpClient.get(BASE_PATH, { - headers: { - "Client-Version": CLIENT_VERSION, - }, - }); + return await this.httpClient.get(BASE_PATH); } } diff --git a/frontend/src/ts/ape/endpoints/results.ts b/frontend/src/ts/ape/endpoints/results.ts index a26ca99a9..246f8a4c2 100644 --- a/frontend/src/ts/ape/endpoints/results.ts +++ b/frontend/src/ts/ape/endpoints/results.ts @@ -1,5 +1,3 @@ -import { CLIENT_VERSION } from "../../version"; - const BASE_PATH = "/results"; export default class Results { @@ -14,7 +12,6 @@ export default class Results { async save(result: MonkeyTypes.Result): Ape.EndpointData { return await this.httpClient.post(BASE_PATH, { payload: { result }, - headers: { "Client-Version": CLIENT_VERSION }, }); }