mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-06 22:07:58 +03:00
Check if header starts with v2, so we can push patches more efficiently.
This commit is contained in:
@@ -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();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user