From 3091b1377632edfb0e2c28766581da6c4e647735 Mon Sep 17 00:00:00 2001 From: tdurieux Date: Mon, 16 Jan 2023 15:03:49 +0100 Subject: [PATCH] fix: send file type based on its extension --- src/AnonymizedFile.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/AnonymizedFile.ts b/src/AnonymizedFile.ts index 6850af5..efc6e46 100644 --- a/src/AnonymizedFile.ts +++ b/src/AnonymizedFile.ts @@ -202,6 +202,9 @@ export default class AnonymizedFile { async send(res: Response): Promise { const pipe = promisify(pipeline); try { + if (await this.extension()) { + res.contentType(await this.extension()); + } await pipe(await this.anonymizedContent(), res); } catch (error) { handleError(error, res);