Fix: Crash in NodeApp.render if req.body is null (#6688)

* Add additional null check for req.body

* Add changeset
This commit is contained in:
Johannes Klauss 2023-03-28 18:24:01 +02:00 committed by GitHub
parent 2df24e9430
commit 2e92e9aa97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Add a additional check for `null` on the `req.body` check in `NodeApp.render`.

View file

@ -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