@fastify/aws-lambda
Advanced tools
Comparing version 5.1.2 to 5.1.3
@@ -125,2 +125,3 @@ 'use strict' | ||
} | ||
const stream = res.stream() | ||
return resolve({ | ||
@@ -131,3 +132,4 @@ meta: { | ||
}, | ||
stream: (res && res.stream()) || require('node:stream').Readable.from('') | ||
// fix issue with Lambda where streaming repsonses always require a body to be present | ||
stream: stream.readableLength > 0 ? stream : require('node:stream').Readable.from('') | ||
}) | ||
@@ -176,5 +178,7 @@ } | ||
const stream = res.stream() | ||
resolve({ | ||
meta: ret, | ||
stream: res.stream() | ||
// fix issue with Lambda where streaming repsonses always require a body to be present | ||
stream: stream.readableLength > 0 ? stream : require('node:stream').Readable.from('') | ||
}) | ||
@@ -181,0 +185,0 @@ }) |
@@ -29,3 +29,3 @@ { | ||
"license": "MIT", | ||
"version": "5.1.2", | ||
"version": "5.1.3", | ||
"main": "index.js", | ||
@@ -32,0 +32,0 @@ "type": "commonjs", |
27810
366