Check if header starts with v2, so we can push patches more efficiently.

This commit is contained in:
zkldi
2021-12-04 10:39:02 +00:00
parent 61af4875de
commit 8d9c3ebcaf
@@ -3,5 +3,12 @@ import { RequestHandler } from "express";
export const ValidateIRClientVersion: RequestHandler = (req, res, next) => {
const header = req.header("X-TachiIR-Version");
if (!header?.startsWith("v2")) {
return res.status(400).json({
success: false,
description: `Invalid X-TachiIR-Version.`,
});
}
return next();
};