Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

kunyan
Copy link
Contributor

@kunyan kunyan commented Dec 5, 2024

Changes

According to https://www.rssboard.org/rss-mime-type-application.txt

The default content type for RSS should be application/rss+xml

Testing

Docs

Copy link

changeset-bot bot commented Dec 5, 2024

🦋 Changeset detected

Latest commit: 0e2f15b

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ematipico
Copy link
Member

@kunyan you might want to update the tests

@kunyan
Copy link
Contributor Author

kunyan commented Dec 5, 2024

@ematipico Looks there are no test for getRssResponse

However, there has another way that use getRssString to generate rss xml an create a own wrapper

const result = await getRssString({...});
return new Response(result, {
    headers: {
      'Content-Type': 'application/xml; charset=utf-8',
    },
  });

I'm think about if we really need change the content type in this place.

The "application/rss+xml" is not able to render by Chrome xml view.
but "applicaiton/xml" is ok.

Maybe we should suggest user choose their way in the docs ?

@ascorbic
Copy link
Contributor

ascorbic commented Dec 5, 2024

There are tests here:

assert.equal(contentType, 'application/xml');

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