removed duplicate header

This commit is contained in:
Miodec 2023-07-25 17:47:17 +02:00
parent a828fcfb01
commit 50c96006c2
4 changed files with 5 additions and 12 deletions

View file

@ -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
)

View file

@ -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");
}

View file

@ -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);
}
}

View file

@ -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<MonkeyTypes.Mode>): Ape.EndpointData {
return await this.httpClient.post(BASE_PATH, {
payload: { result },
headers: { "Client-Version": CLIENT_VERSION },
});
}