mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-17 19:15:59 +08:00
removed duplicate header
This commit is contained in:
parent
a828fcfb01
commit
50c96006c2
4 changed files with 5 additions and 12 deletions
|
@ -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
|
||||
)
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 },
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue