feat(core): add a new environment variable to configure the output format (#22738)
This commit is contained in:
@@ -19,7 +19,7 @@ const middleware: MiddlewareHandler = async (ctx, next) => {
|
||||
}
|
||||
|
||||
const requestPath = ctx.req.path;
|
||||
const format = `:${ctx.req.query('format') || 'rss'}`;
|
||||
const format = `:${ctx.req.query('format') || config.format}`;
|
||||
const limit = ctx.req.query('limit') ? `:${ctx.req.query('limit')}` : '';
|
||||
const key = 'rsshub:koa-redis-cache:' + h64ToString(requestPath + format + limit);
|
||||
const controlKey = 'rsshub:path-requested:' + h64ToString(requestPath + format + limit);
|
||||
|
||||
@@ -20,7 +20,7 @@ const middleware: MiddlewareHandler = async (ctx, next) => {
|
||||
}
|
||||
|
||||
const data: Data = ctx.get('data');
|
||||
const outputType = ctx.req.query('format') || 'rss';
|
||||
const outputType = ctx.req.query('format') || config.format;
|
||||
|
||||
// only enable when debugInfo=true
|
||||
if (config.debugInfo) {
|
||||
|
||||
Reference in New Issue
Block a user