From 276f5e1d94049666b6b66b68a5ff7d87ab436b6d Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 26 Feb 2025 17:47:38 +0800 Subject: [PATCH] fix: specify charset in RSS 2 content type - Add charset specification to the RSS 2 content type in the `resolveContentType` function. Signed-off-by: Jack --- src/runtime/server/feed.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/server/feed.ts b/src/runtime/server/feed.ts index 9b6656b..26c0a99 100644 --- a/src/runtime/server/feed.ts +++ b/src/runtime/server/feed.ts @@ -8,7 +8,7 @@ import type { SourceOptions, FeedType } from '../../types' function resolveContentType(type: FeedType) { const lookup = { - rss2: 'application/rss+xml', + rss2: 'application/rss+xml; charset=UTF-8', atom1: 'application/atom+xml', json1: 'application/json' } @@ -34,4 +34,4 @@ export default defineEventHandler(async (event: H3Event) => { setHeader(event, 'cache-control', `max-age=${options.cacheTime}`) const feed = await createFeed(options) return feed -}) \ No newline at end of file +})