mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
require header for incomplete uploads
This commit is contained in:
@@ -115,7 +115,20 @@ describe(AssetUploadController.name, () => {
|
|||||||
expect(body).toEqual(expect.objectContaining({ message: 'Expected valid upload-complete header' }));
|
expect(body).toEqual(expect.objectContaining({ message: 'Expected valid upload-complete header' }));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should infer upload length from non-empty content length if complete upload', async () => {
|
it('should require Upload-Length header for incomplete upload', async () => {
|
||||||
|
const { status, body } = await request(ctx.getHttpServer())
|
||||||
|
.post('/upload')
|
||||||
|
.set('Upload-Draft-Interop-Version', '8')
|
||||||
|
.set('X-Immich-Asset-Data', makeAssetData())
|
||||||
|
.set('Repr-Digest', checksum)
|
||||||
|
.set('Upload-Complete', '?0')
|
||||||
|
.send(buffer);
|
||||||
|
|
||||||
|
expect(status).toBe(400);
|
||||||
|
expect(body).toEqual(expect.objectContaining({ message: 'Missing upload-length header' }));
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should infer upload length from content length if complete upload', async () => {
|
||||||
const { status } = await request(ctx.getHttpServer())
|
const { status } = await request(ctx.getHttpServer())
|
||||||
.post('/upload')
|
.post('/upload')
|
||||||
.set('Upload-Draft-Interop-Version', '8')
|
.set('Upload-Draft-Interop-Version', '8')
|
||||||
|
|||||||
Reference in New Issue
Block a user