diff --git a/.changeset/funny-pets-walk.md b/.changeset/funny-pets-walk.md new file mode 100644 index 000000000000..0327d43d2c3e --- /dev/null +++ b/.changeset/funny-pets-walk.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Add a additional check for `null` on the `req.body` check in `NodeApp.render`. diff --git a/packages/astro/src/core/app/node.ts b/packages/astro/src/core/app/node.ts index e7a3efca81ce..97d7b71d18dd 100644 --- a/packages/astro/src/core/app/node.ts +++ b/packages/astro/src/core/app/node.ts @@ -48,7 +48,7 @@ export class NodeApp extends App { ); } - if (typeof req.body === 'object' && Object.keys(req.body).length > 0) { + if (typeof req.body === 'object' && req.body !== null && Object.keys(req.body).length > 0) { return super.render( req instanceof Request ? req