feat(transcode): stream uploads and transcode output to prevent memory crashes on large files

This commit is contained in:
yiling
2026-07-29 21:22:49 +08:00
parent 7949c1572a
commit 9a4f8d67c3
5 changed files with 41 additions and 21 deletions
+4 -1
View File
@@ -94,11 +94,14 @@ describe('S3 API', () => {
const res = await app.request('/files/b1/test.webp', {
method: 'PUT',
headers: {
'content-length': body.byteLength.toString(),
},
body,
})
expect(res.status).toBe(200)
expect(await res.text()).toBe('OK')
expect(mockPut).toHaveBeenCalledWith('b1', 'test.webp', expect.any(Buffer), body.byteLength)
expect(mockPut).toHaveBeenCalledWith('b1', 'test.webp', expect.anything(), body.byteLength)
})
})