@maioradv/nestjs-core 1.9.5 → 1.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,14 @@ exports.DEFAULT_MAX_IMAGE_SIZE = 10;
6
6
  //heic uploaded as application/octet-stream
7
7
  exports.DEFAULT_MIMETYPES_SUPPORT = '.(webp|avif|png|gif|jpeg|jpg)';
8
8
  const ImagePipeValidator = (options) => new common_1.ParseFilePipeBuilder()
9
- .addFileTypeValidator({ fileType: options?.mimeTypes ? `.(${options.mimeTypes.join('|')})` : exports.DEFAULT_MIMETYPES_SUPPORT })
10
- .addMaxSizeValidator({ maxSize: (options?.maxSize ?? exports.DEFAULT_MAX_IMAGE_SIZE) * 1e6 })
11
- .build({ errorHttpStatusCode: common_1.HttpStatus.UNPROCESSABLE_ENTITY });
9
+ .addFileTypeValidator({
10
+ fileType: options?.mimeTypes ? `.(${options.mimeTypes.join('|')})` : exports.DEFAULT_MIMETYPES_SUPPORT,
11
+ skipMagicNumbersValidation: true
12
+ })
13
+ .addMaxSizeValidator({
14
+ maxSize: (options?.maxSize ?? exports.DEFAULT_MAX_IMAGE_SIZE) * 1e6
15
+ })
16
+ .build({
17
+ errorHttpStatusCode: common_1.HttpStatus.UNPROCESSABLE_ENTITY
18
+ });
12
19
  exports.ImagePipeValidator = ImagePipeValidator;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maioradv/nestjs-core",
3
- "version": "1.9.5",
3
+ "version": "1.9.7",
4
4
  "description": "NestJS helpers by MaiorADV",
5
5
  "repository": "https://github.com/maioradv/nestjs-core.git",
6
6
  "author": "Maior ADV Srl",