🐛 Fix rss feed charset issue

This commit is contained in:
LittleSheep 2024-08-17 10:57:57 +08:00
parent 8e28781cbc
commit 3615c170f6

View File

@ -68,11 +68,13 @@ export default defineEventHandler(async (event) => {
switch (queries.type) {
case "json":
setResponseHeader(event, "Content-Type", "application/json; charset=utf-8")
return feed.json1()
case "rss":
setResponseHeader(event, "Content-Type", "application/rss+xml; charset=utf-8")
return feed.rss2()
default:
setResponseHeader(event, "Content-Type", "application/rss+xml; charset=utf-8")
return feed.atom1()
}
})