feat: allow empty for certain routes

This commit is contained in:
DIYgod
2019-06-14 11:14:24 +08:00
parent 8f32c54a77
commit 3c0bfeff97
2 changed files with 2 additions and 1 deletions

View File

@@ -3,7 +3,7 @@ const he = require('he');
module.exports = async (ctx, next) => {
await next();
if (ctx.state.data && (!ctx.state.data.item || ctx.state.data.item.length === 0)) {
if (ctx.state.data && (!ctx.state.data.item || ctx.state.data.item.length === 0) && !ctx.state.allowEmpty) {
throw Error('this route is empty, please check the origin site or create an issue to feedback on https://github.com/DIYgod/RSSHub/issues/new/choose');
}