Skip to content

Commit

Permalink
Fix: Crash in NodeApp.render if req.body is null (#6688)
Browse files Browse the repository at this point in the history
* Add additional null check for req.body

* Add changeset
  • Loading branch information
JohannesKlauss authored Mar 28, 2023
1 parent 2df24e9 commit 2e92e9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/funny-pets-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Add a additional check for `null` on the `req.body` check in `NodeApp.render`.
2 changes: 1 addition & 1 deletion packages/astro/src/core/app/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2e92e9a

Please sign in to comment.