nitro-nightly 3.0.1-20251118-175529-0316c6c6 → 3.0.1-20251124-125031-a5ca8fc9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -10,16 +10,18 @@ export const handler = awslambda.streamifyResponse(async (event, responseStream,
|
|
|
10
10
|
statusCode: response.status,
|
|
11
11
|
...awsResponseHeaders(response)
|
|
12
12
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
const body = response.body ?? new ReadableStream({ start(controller) {
|
|
14
|
+
controller.enqueue("");
|
|
15
|
+
controller.close();
|
|
16
|
+
} });
|
|
17
|
+
const writer = awslambda.HttpResponseStream.from(
|
|
18
|
+
// @ts-expect-error TODO: IMPORTANT! It should be a Writable according to the aws-lambda types
|
|
19
|
+
responseStream,
|
|
20
|
+
httpResponseMetadata
|
|
21
|
+
);
|
|
22
|
+
const reader = body.getReader();
|
|
23
|
+
await streamToNodeStream(reader, responseStream);
|
|
24
|
+
writer.end();
|
|
23
25
|
});
|
|
24
26
|
async function streamToNodeStream(reader, writer) {
|
|
25
27
|
let readResult = await reader.read();
|
package/package.json
CHANGED