We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 83f91e9 commit cf077c8Copy full SHA for cf077c8
src/response.js
@@ -33,10 +33,12 @@ class Response extends EventEmitter {
33
if (this.writableEnded) throw new Error('write after end')
34
this.writableEnded = true
35
this.emit('finished')
36
+ const body = this[AWS_RES_BODY]
37
+ const bodyStr = body === 'string' ? body : JSON.stringify(body)
38
const apiGatewayResult = {
39
statusCode: this.statusCode,
40
headers: this[AWS_RES_HEADERS],
- body: this[AWS_RES_BODY]
41
+ body: bodyStr
42
}
43
this[ON_FINISHED](apiGatewayResult)
44
0 commit comments