Skip to content

fix(@astrojs/rss): revert incorrect Content-Type header applied for RSS XML file#12829

Merged
ematipico merged 2 commits intowithastro:mainfrom
SapphoSys:fix-rss
Dec 26, 2024
Merged

fix(@astrojs/rss): revert incorrect Content-Type header applied for RSS XML file#12829
ematipico merged 2 commits intowithastro:mainfrom
SapphoSys:fix-rss

Conversation

@SapphoSys
Copy link
Copy Markdown
Contributor

@SapphoSys SapphoSys commented Dec 24, 2024

Changes

This fixes an issue where the RSS XML file generated by @astrojs/rss is displayed in plaintext due to a faulty Content-Type header by reverting the #12644 pull request.

For more information, you can view the #12828 issue that I filed.

Example screenshots

Before (current, Content-Type header is set to application/rss+xml; charset=utf-8 since astro@5.0.3)

msedge_t86IuPt0Pq

After (manually overriding the Content-Type header to application/xml which was the value used by @astrojs/rss before the PR change)

msedge_pumxsK772k

Testing

A reproducible example can be found here: https://codesandbox.io/p/devbox/kind-hugle-27v5l?on=codesandbox

Or, if you want to reproduce it yourself:

  • Go to https://astro.new and find the Blog template
  • Open the Blog template in CodeSandbox
  • Visit the /rss.xml RSS XML page

You should see the XML page being displayed in plaintext.

Reproducible example screenshot for the "Blog" Template in CodeSandbox

msedge_4MsvTN5VE4

@ematipico ematipico merged commit ebe2aa9 into withastro:main Dec 26, 2024
@astrobot-houston astrobot-houston mentioned this pull request Dec 26, 2024
@kripod
Copy link
Copy Markdown

kripod commented Jun 5, 2025

While the fix works for most browsers, it breaks iOS Safari support, which, I think, was the main motive behind #12644.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants