This commit is contained in:
chaosBreaking
2019-10-01 23:58:25 +08:00
parent d7aae190f0
commit 9015ba7064
3 changed files with 5 additions and 4 deletions

View File

@@ -13,9 +13,9 @@ module.exports = {
const { sig, ts } = req.headers;
const salt = SysConfig.LIMITSALT;
const my = crypto.hash(ts + req.path + salt, { hasher: 'md5' });
const invalid = sig !== my || Date.now() - ts > 60000;
const invalid = sig !== my || Date.now() - ts > 5000;
if (invalid) {
return res.status(403).send('unauthorized');
return res.status(408).send('timeout');
}
}
if(!ignoreToken.includes(req.path)) {