next.js
352cc23f - Strip completeness marker from server action redirect responses

Commit
2 days ago
Strip completeness marker from server action redirect responses Server action redirects to fully static pages include the prerendered flight data for the redirect target, which has the `ResponseCompletenessMarker` byte prepended at build time. The server action reducer passed this response directly to React's `createFromFetch` without stripping the marker, causing a `Connection closed` error because the marker byte is not valid RSC Flight data. Fix by running the response through `processFetch` (which calls `stripCompletenessMarker`) before passing it to `createFromFetch`. Also export `processFetch` so it can be reused, and preserve the `redirected` property on the reconstructed `Response` since the `Response` constructor does not carry it over from the original.
Author
Committer
Parents
Loading