next.js
35d6fdf0 - fix(nodejs-middleware): await for body cloning to be properly finalized (#85418)

Commit
97 days ago
fix(nodejs-middleware): await for body cloning to be properly finalized (#85418) Fixes https://github.com/vercel/next.js/issues/85416. This is a follow up to https://github.com/vercel/next.js/pull/77662, where the Node.js middleware was fixed to also support reading (and duplicating) the body's request before being passed to the server action. However, in that PR, an `await` was missed while calling the [.finalize()](https://github.com/vercel/next.js/blob/1b45163bce3dab30d7a79dff95238b84016b54c2/packages/next/src/server/body-streams.ts#L39) method, which returns a Promise. That missing `await` would sometimes cause a bug, where the server action would be invoked before the body was completely cloned, causing the bug mentioned in the issue above. --------- Co-authored-by: JJ Kasper <jj@jjsweb.site>
Author
Parents
Loading