Skip to content

Commit 9deffab

Browse files
committed
Buffer.from '' if this.app._event.body is falsy
fix: #123
1 parent b2a8503 commit 9deffab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/request.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ class REQUEST {
159159
this.rawBody = this.app._event.body
160160

161161
// Set the body (decode it if base64 encoded)
162-
this.body = this.app._event.isBase64Encoded ? Buffer.from(this.app._event.body, 'base64').toString() : this.app._event.body
163-
162+
this.body = this.app._event.isBase64Encoded ? Buffer.from(this.app._event.body||'', 'base64').toString() : this.app._event.body
163+
164164
// Set the body
165165
if (this.headers['content-type'] && this.headers['content-type'].includes('application/x-www-form-urlencoded')) {
166166
this.body = QS.parse(this.body)

0 commit comments

Comments
 (0)