Set content-type charset=utf-8 for feeds.

Hope this helps.
This commit is contained in:
Cadence Ember 2022-05-23 00:15:40 +12:00
parent 49445ffb73
commit 6b72622939
No known key found for this signature in database
GPG Key ID: BC1C2C61CF521B17
1 changed files with 2 additions and 2 deletions

View File

@ -13,12 +13,12 @@ p(style="white-space: pre-line") #{message}#[a(href=link)= link]
function respondWithFeed(feed, kind, maxAge, available) {
if (kind === "rss") {
var data = {
contentType: "application/rss+xml", // see https://stackoverflow.com/questions/595616/what-is-the-correct-mime-type-to-use-for-an-rss-feed,
contentType: "application/rss+xml; charset=utf-8", // see https://stackoverflow.com/questions/595616/what-is-the-correct-mime-type-to-use-for-an-rss-feed,
content: feed.rss2()
}
} else if (kind === "atom") {
var data = {
contentType: "application/atom+xml", // see https://en.wikipedia.org/wiki/Atom_(standard)#Including_in_HTML
contentType: "application/atom+xml; charset=utf-8", // see https://en.wikipedia.org/wiki/Atom_(standard)#Including_in_HTML
content: feed.atom1()
}
}