diff --git a/.changeset/tender-kiwis-happen.md b/.changeset/tender-kiwis-happen.md new file mode 100644 index 000000000000..a7c5db35b6f5 --- /dev/null +++ b/.changeset/tender-kiwis-happen.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': patch +--- + +[fix] correctly strip data suffix at root page diff --git a/packages/kit/src/runtime/server/index.js b/packages/kit/src/runtime/server/index.js index 007e029d6b48..3158bd2495b0 100644 --- a/packages/kit/src/runtime/server/index.js +++ b/packages/kit/src/runtime/server/index.js @@ -63,7 +63,7 @@ export async function respond(request, options, state) { } const is_data_request = has_data_suffix(decoded); - if (is_data_request) decoded = strip_data_suffix(decoded); + if (is_data_request) decoded = strip_data_suffix(decoded) || '/'; if (!state.prerendering?.fallback) { const matchers = await options.manifest._.matchers();