Skip to content

fix: prerender and crawl pages whose content-type header carries a charset parameter - #16567

Merged
Rich-Harris merged 2 commits into
sveltejs:version-3from
Nic-Polumeyv:fix-prerender-content-type
Jul 30, 2026
Merged

fix: prerender and crawl pages whose content-type header carries a charset parameter#16567
Rich-Harris merged 2 commits into
sveltejs:version-3from
Nic-Polumeyv:fix-prerender-content-type

Conversation

@Nic-Polumeyv

@Nic-Polumeyv Nic-Polumeyv commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

The prerenderer compares content-type with ===, so text/html; charset=utf-8 is not treated as HTML: the page is written without a .html extension and its links are never crawled. is_content_type already normalizes the header for this reason, from #7195 (strip parameters) and GHSA-gv7g-x59x-wf8f (case-insensitive compare); the two prerender checks predate both.

Reproduces #13612, closed as unreproducible, using the charset workaround from #3184. The root +server.js error added in #15994 is gated on the same value, so it can fire for an app that has none.

@pkg-svelte-dev

pkg-svelte-dev Bot commented Jul 29, 2026

Copy link
Copy Markdown

Install the latest version of @sveltejs/kit from d961820:

pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/d961820b0848bacf2d5c1d595c52d35ef24ac46c

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/kit/pr/16567

Note

This PR is from a fork. A maintainer must approve approve each commit before it can be built and installed.

@changeset-bot

changeset-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d961820

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

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

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

@Rich-Harris Rich-Harris left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thank you

@Rich-Harris
Rich-Harris merged commit ff4247e into sveltejs:version-3 Jul 30, 2026
21 of 22 checks passed
@Nic-Polumeyv
Nic-Polumeyv deleted the fix-prerender-content-type branch July 30, 2026 22:53
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.

2 participants