fix: middleware errors

This commit is contained in:
DIYgod
2024-01-21 18:35:11 +08:00
parent e7e3f689bd
commit 4591116733
14 changed files with 126 additions and 322 deletions

View File

@@ -29,11 +29,7 @@ const middleware: MiddlewareHandler = async (ctx, next) => {
if (value) {
ctx.status(200)
if (config.cache.type === 'redis') {
ctx.header('X-Koa-Redis-Cache', 'true')
} else if (config.cache.type === 'memory') {
ctx.header('X-Koa-Memory-Cache', 'true')
}
ctx.header('RSSHub-Cache-Status', 'HIT')
ctx.set('data', JSON.parse(value))
await next();
return;