mirror of
https://github.com/immich-app/immich.git
synced 2025-12-26 12:52:16 -08: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' }));
|
||||
});
|
||||
|
||||
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())
|
||||
.post('/upload')
|
||||
.set('Upload-Draft-Interop-Version', '8')
|
||||
|
||||
Reference in New Issue
Block a user