mirror of
https://github.com/immich-app/immich
synced 2026-08-15 13:03:57 +00:00
fix: zero byte image uploads (#29426)
This commit is contained in:
parent
c50a807bc1
commit
80cdfebbc7
1 changed files with 4 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { CallHandler, ExecutionContext, Injectable, NestInterceptor } from '@nestjs/common';
|
||||
import { BadRequestException, CallHandler, ExecutionContext, Injectable, NestInterceptor } from '@nestjs/common';
|
||||
import { PATH_METADATA } from '@nestjs/common/constants';
|
||||
import { Reflector } from '@nestjs/core';
|
||||
import { transformException } from '@nestjs/platform-express/multer/multer/multer.utils';
|
||||
|
|
@ -129,6 +129,9 @@ export class FileUploadInterceptor implements NestInterceptor {
|
|||
hash?.destroy();
|
||||
return callback(error);
|
||||
}
|
||||
if (size === 0) {
|
||||
return callback(new BadRequestException('File is empty'));
|
||||
}
|
||||
callback(null, {
|
||||
path,
|
||||
size,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue