diff --git a/middleware/template.js b/middleware/template.js index 02b4f1b21..45acacbe8 100644 --- a/middleware/template.js +++ b/middleware/template.js @@ -3,8 +3,13 @@ const path = require('path'); const config = require('../config'); const he = require('he'); const typeRegrx = /\.(atom|rss)$/; +const unsupportedRegrx = /\.json$/; module.exports = async (ctx, next) => { + if (ctx.request.path.match(unsupportedRegrx)) { + throw Error('JSON output had been removed, see: https://github.com/DIYgod/RSSHub/issues/1114'); + } + ctx.state.type = ctx.request.path.match(typeRegrx) || ['', '']; ctx.request.path = ctx.request.path.replace(typeRegrx, '');