Skip to content

Commit 5b9b618

Browse files
kunyanascorbic
andauthoredDec 5, 2024··
fix(@astrojs/rss): use standard rss content type, add utf-8 charset (#12644)
* fix(@astrojs/rss): use standard rss content type, add utf-8 charset * Update .changeset/loud-cobras-rhyme.md --------- Co-authored-by: Matt Kane <m@mk.gg>
1 parent 86abfa5 commit 5b9b618

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed
 

‎.changeset/loud-cobras-rhyme.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@astrojs/rss': patch
3+
---
4+
5+
Sends the standard RSS content type response header, with UTF-8 charset

‎packages/astro-rss/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export default async function getRssResponse(rssOptions: RSSOptions): Promise<Re
8989
const rssString = await getRssString(rssOptions);
9090
return new Response(rssString, {
9191
headers: {
92-
'Content-Type': 'application/xml',
92+
'Content-Type': 'application/rss+xml; charset=utf-8',
9393
},
9494
});
9595
}

‎packages/astro-rss/test/rss.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describe('rss', () => {
6262
assertXmlDeepEqual(str, validXmlResult);
6363

6464
const contentType = response.headers.get('Content-Type');
65-
assert.equal(contentType, 'application/xml');
65+
assert.equal(contentType, 'application/rss+xml; charset=utf-8');
6666
});
6767

6868
it('should be the same string as getRssString', async () => {

0 commit comments

Comments
 (0)
Please sign in to comment.