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 server island script breaking when charset is added to content-type #12810

Merged

Conversation

louisescher
Copy link
Contributor

@louisescher louisescher commented Dec 23, 2024

Changes

  • This PR fixes an issue where the client-side script injected for server islands would fail if the content-type header was modified from an external source, for example a reverse proxy.

Testing

  • Added a new server island to the server islands tests which sets a header with a media type. The test checks if the island gets inserted even with the media type present (content-type: text/html;charset=utf-8). Normal cases are automatically handled by the other server islands which do not set the header and instead have the default header (content-type: text/html)

Docs

No docs needed as this is a bug fix and doesn't change the default behavior.

Copy link

changeset-bot bot commented Dec 23, 2024

🦋 Changeset detected

Latest commit: 953b4dc

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

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Dec 23, 2024
@Fryuni Fryuni self-requested a review December 23, 2024 00:30
Copy link

codspeed-hq bot commented Dec 23, 2024

CodSpeed Performance Report

Merging #12810 will not alter performance

Comparing louisescher:fix-server-island-content-type-check (953b4dc) with main (98f9e83)

Summary

✅ 4 untouched benchmarks

@louisescher louisescher marked this pull request as ready for review December 23, 2024 10:28
Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! This fix looks good to me

@ematipico ematipico merged commit 70a9f0b into withastro:main Dec 23, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants