mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-05 04:11:26 +08:00
refactor: avoid promise overhead (#8028)
This commit is contained in:
@@ -29,24 +29,24 @@ module.exports = async (ctx, next) => {
|
||||
await next();
|
||||
} else {
|
||||
if (!isControlled || allowLocalhost) {
|
||||
return await grant();
|
||||
return grant();
|
||||
}
|
||||
|
||||
if (config.accessKey) {
|
||||
if (config.accessKey === accessKey || accessCode === md5(requestPath + config.accessKey)) {
|
||||
return await grant();
|
||||
return grant();
|
||||
}
|
||||
}
|
||||
|
||||
if (config.whitelist) {
|
||||
if (config.whitelist.find((white) => ip.includes(white) || requestPath.includes(white) || requestUA.includes(white))) {
|
||||
return await grant();
|
||||
return grant();
|
||||
}
|
||||
}
|
||||
|
||||
if (config.blacklist) {
|
||||
if (!config.blacklist.find((black) => ip.includes(black) || requestPath.includes(black) || requestUA.includes(black))) {
|
||||
return await grant();
|
||||
return grant();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user