mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-07 05:36:08 +08:00
feat: allow empty for certain routes
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user