mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
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>
This commit is contained in:
parent
86abfa5c81
commit
5b9b618183
3 changed files with 7 additions and 2 deletions
5
.changeset/loud-cobras-rhyme.md
Normal file
5
.changeset/loud-cobras-rhyme.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@astrojs/rss': patch
|
||||
---
|
||||
|
||||
Sends the standard RSS content type response header, with UTF-8 charset
|
|
@ -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',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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 () => {
|
||||
|
|
Loading…
Reference in a new issue