diff --git a/lib/request.js b/lib/request.js index f72a532..cdef980 100644 --- a/lib/request.js +++ b/lib/request.js @@ -159,8 +159,8 @@ class REQUEST { this.rawBody = this.app._event.body // Set the body (decode it if base64 encoded) - this.body = this.app._event.isBase64Encoded ? Buffer.from(this.app._event.body, 'base64').toString() : this.app._event.body - + this.body = this.app._event.isBase64Encoded ? Buffer.from(this.app._event.body||'', 'base64').toString() : this.app._event.body + // Set the body if (this.headers['content-type'] && this.headers['content-type'].includes('application/x-www-form-urlencoded')) { this.body = QS.parse(this.body)