nitropack-nightly 2.11.12-20250501-152448.ab1cd033 → 2.11.12-20250512-220511.5ac63720
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.
package/dist/meta/index.mjs
CHANGED
|
@@ -38,24 +38,28 @@ export const handler = awslambda.streamifyResponse(
|
|
|
38
38
|
"Transfer-Encoding": "chunked"
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
httpResponseMetadata
|
|
46
|
-
);
|
|
47
|
-
if (!r.body.getReader) {
|
|
48
|
-
writer.write(
|
|
49
|
-
r.body
|
|
50
|
-
/* TODO */
|
|
51
|
-
);
|
|
52
|
-
writer.end();
|
|
53
|
-
return;
|
|
41
|
+
const body = r.body ?? new ReadableStream({
|
|
42
|
+
start(controller) {
|
|
43
|
+
controller.enqueue("");
|
|
44
|
+
controller.close();
|
|
54
45
|
}
|
|
55
|
-
|
|
56
|
-
|
|
46
|
+
});
|
|
47
|
+
const writer = awslambda.HttpResponseStream.from(
|
|
48
|
+
// @ts-expect-error TODO: IMPORTANT! It should be a Writable according to the aws-lambda types
|
|
49
|
+
responseStream,
|
|
50
|
+
httpResponseMetadata
|
|
51
|
+
);
|
|
52
|
+
if (!body.getReader) {
|
|
53
|
+
writer.write(
|
|
54
|
+
r.body
|
|
55
|
+
/* TODO */
|
|
56
|
+
);
|
|
57
57
|
writer.end();
|
|
58
|
+
return;
|
|
58
59
|
}
|
|
60
|
+
const reader = body.getReader();
|
|
61
|
+
await streamToNodeStream(reader, responseStream);
|
|
62
|
+
writer.end();
|
|
59
63
|
}
|
|
60
64
|
);
|
|
61
65
|
async function streamToNodeStream(reader, writer) {
|
package/package.json
CHANGED