mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-11 15:47:48 +08:00
fix Content-Type in cached response
This commit is contained in:
@@ -86,8 +86,10 @@ module.exports = function(options = {}) {
|
||||
if (Buffer.isBuffer(type)) {
|
||||
type = type.toString();
|
||||
}
|
||||
ctx.response.set('X-Koa-Memory-Cache', 'true');
|
||||
ctx.response.type = type;
|
||||
ctx.response.set({
|
||||
'X-Koa-Memory-Cache': 'true',
|
||||
'Content-Type': type,
|
||||
});
|
||||
try {
|
||||
ctx.state.data = JSON.parse(value);
|
||||
} catch (e) {
|
||||
@@ -121,7 +123,7 @@ module.exports = function(options = {}) {
|
||||
* cacheType
|
||||
*/
|
||||
async function cacheType(ctx, tkey) {
|
||||
const type = ctx.response.type;
|
||||
const type = ctx.response.headers['content-type'];
|
||||
if (type) {
|
||||
memoryCache.set(tkey, type);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user