add redirect info

This commit is contained in:
feie9456 2025-05-13 08:56:30 +08:00
parent fc68c8504f
commit a286cf778a

View File

@ -44,6 +44,12 @@ app.get<{ Params: { pj: string, ['*']: string }, Querystring: { secretKey: strin
const { pj, '*': pth } = req.params;
const targetFile = path.join(pj, pth);
if (pj + "/" + pth != targetFile) {
return res.status(400).send({
message: `Use ${targetFile} instead of ${pj + pth}`
});
}
if (!verifyHmac(targetFile, secretKey, req.query.secretKey)) {
return res.status(401).send({
message: 'Invalid secret key'