Skip to content

Commit

Permalink
fix(@astrojs/rss): use standard rss content type, add utf-8 charset (#…
Browse files Browse the repository at this point in the history
…12644)

* fix(@astrojs/rss): use standard rss content type, add utf-8 charset

* Update .changeset/loud-cobras-rhyme.md

---------

Co-authored-by: Matt Kane <[email protected]>
  • Loading branch information
kunyan and ascorbic authored Dec 5, 2024
1 parent 86abfa5 commit 5b9b618
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/loud-cobras-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/rss': patch
---

Sends the standard RSS content type response header, with UTF-8 charset
2 changes: 1 addition & 1 deletion packages/astro-rss/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default async function getRssResponse(rssOptions: RSSOptions): Promise<Re
const rssString = await getRssString(rssOptions);
return new Response(rssString, {
headers: {
'Content-Type': 'application/xml',
'Content-Type': 'application/rss+xml; charset=utf-8',
},
});
}
Expand Down
2 changes: 1 addition & 1 deletion packages/astro-rss/test/rss.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('rss', () => {
assertXmlDeepEqual(str, validXmlResult);

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

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

0 comments on commit 5b9b618

Please sign in to comment.