add redirect info
This commit is contained in:
parent
fc68c8504f
commit
a286cf778a
6
index.ts
6
index.ts
@ -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'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user