diff --git a/apps/server/src/core/attachment/attachment.controller.ts b/apps/server/src/core/attachment/attachment.controller.ts index 3215a74d..73c9699a 100644 --- a/apps/server/src/core/attachment/attachment.controller.ts +++ b/apps/server/src/core/attachment/attachment.controller.ts @@ -464,7 +464,8 @@ export class AttachmentController { 'Cache-Control': `${cacheScope}, max-age=3600`, }); - if (fileSize) { + const isSvg = attachment.fileExt === '.svg'; + if (fileSize && !isSvg) { res.header('Content-Length', fileSize); } diff --git a/apps/server/src/core/attachment/services/attachment.service.ts b/apps/server/src/core/attachment/services/attachment.service.ts index ea94b983..7a6b228f 100644 --- a/apps/server/src/core/attachment/services/attachment.service.ts +++ b/apps/server/src/core/attachment/services/attachment.service.ts @@ -99,6 +99,7 @@ export class AttachmentService { if (isUpdate) { attachment = await this.attachmentRepo.updateAttachment( { + fileSize: preparedFile.fileSize, updatedAt: new Date(), }, attachmentId,