add redirect info
This commit is contained in:
parent
a286cf778a
commit
568138c36f
3
index.ts
3
index.ts
@ -35,7 +35,6 @@ function createHmac(message: string, secretKey: string) {
|
|||||||
// 验证 HMAC
|
// 验证 HMAC
|
||||||
function verifyHmac(message: string, secretKey: string, hash: string) {
|
function verifyHmac(message: string, secretKey: string, hash: string) {
|
||||||
const calculatedHash = createHmac(message, secretKey);
|
const calculatedHash = createHmac(message, secretKey);
|
||||||
console.log(`calculatedHash: ${calculatedHash}, hash: ${hash}`);
|
|
||||||
|
|
||||||
return calculatedHash === hash;
|
return calculatedHash === hash;
|
||||||
}
|
}
|
||||||
@ -46,7 +45,7 @@ app.get<{ Params: { pj: string, ['*']: string }, Querystring: { secretKey: strin
|
|||||||
|
|
||||||
if (pj + "/" + pth != targetFile) {
|
if (pj + "/" + pth != targetFile) {
|
||||||
return res.status(400).send({
|
return res.status(400).send({
|
||||||
message: `Use ${targetFile} instead of ${pj + pth}`
|
message: `Use ${targetFile} as path instead`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user