feat: allow empty for certain routes
This commit is contained in:
parent
8f32c54a77
commit
3c0bfeff97
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,4 +49,5 @@ module.exports = async (ctx) => {
|
|||
link,
|
||||
item,
|
||||
};
|
||||
ctx.state.allowEmpty = true;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue