Skip to content

Commit

Permalink
fix(@astrojs/rss): revert incorrect Content-Type header applied for R…
Browse files Browse the repository at this point in the history
…SS XML file (#12829)

* fix: revert content-type changes

* chore: changeset
  • Loading branch information
SapphicMoe authored Dec 26, 2024
1 parent 1fab2f2 commit ebe2aa9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/hot-pumas-attack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/rss': patch
---

Revert incorrect Content-Type header applied for RSS XML file
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/rss+xml; charset=utf-8',
'Content-Type': 'application/xml',
},
});
}
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/rss+xml; charset=utf-8');
assert.equal(contentType, 'application/xml');
});

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

0 comments on commit ebe2aa9

Please sign in to comment.