dont stream data when client is gone

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

View file

@ -17,6 +17,7 @@ export const GET = async ({ params, locals }) => {
const metadata = await minio.statObject(BUCKET, `${file.uploader.id}/${file.internalName}`);
const ac = new AbortController();
ac.signal.onabort = () => object.destroy;
const stream = new ReadableStream({
start(controller) {