Skip to content

Commit e9944fe

Browse files
authored
Merge pull request #124 from btakita/gh-123
Buffer.from '' if this.app._event.body is falsy
2 parents 5cb096c + 9deffab commit e9944fe

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)