make sure to close stream when done

This commit is contained in:
cirroskais 2024-07-06 02:22:33 -04:00
parent 9b48794fcf
commit 573e44053f
No known key found for this signature in database
GPG key ID: 5FC73EBF2678E33D

View file

@ -24,6 +24,9 @@ export const GET = async ({ params, locals }) => {
object.on('data', (chunk) => {
controller.enqueue(chunk);
});
object.on('end', () => {
controller.close();
});
},
cancel() {
ac.abort();