diff options
author | 2023-03-28 18:24:01 +0200 | |
---|---|---|
committer | 2023-03-28 12:24:01 -0400 | |
commit | 2e92e9aa976735c3ddb647152bb9c4850136e386 (patch) | |
tree | db03cf03d345f7dbad0b5d781f0e11187152a629 | |
parent | 2df24e94303253565e880468c1c371a3e2baaa09 (diff) | |
download | astro-2e92e9aa976735c3ddb647152bb9c4850136e386.tar.gz astro-2e92e9aa976735c3ddb647152bb9c4850136e386.tar.zst astro-2e92e9aa976735c3ddb647152bb9c4850136e386.zip |
Fix: Crash in NodeApp.render if req.body is null (#6688)
* Add additional null check for req.body
* Add changeset
-rw-r--r-- | .changeset/funny-pets-walk.md | 5 | ||||
-rw-r--r-- | packages/astro/src/core/app/node.ts | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/.changeset/funny-pets-walk.md b/.changeset/funny-pets-walk.md new file mode 100644 index 000000000..0327d43d2 --- /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 e7a3efca8..97d7b71d1 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 |