mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-05 20:27:52 +08:00
fix: retain allowEmpty in ctx.state (#2542)
* fix: retain allowEmpty in ctx.state See: https://github.com/koajs/koa/issues/1172 * fix: pass test case allow_empty * chore: get rid of eslint warning
This commit is contained in:
@@ -7,8 +7,8 @@ module.exports = async (ctx, next) => {
|
||||
throw Error('wrong path');
|
||||
}
|
||||
|
||||
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');
|
||||
if (ctx.state.data && (!ctx.state.data.item || ctx.state.data.item.length === 0) && !ctx.state.data.allowEmpty) {
|
||||
throw Error('this route is empty, please check the original site or create an issue on https://github.com/DIYgod/RSSHub/issues/new/choose');
|
||||
}
|
||||
|
||||
// decode HTML entities
|
||||
|
||||
Reference in New Issue
Block a user