@nestjs/common 11.1.10 → 11.1.12
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.
- package/LICENSE +1 -1
- package/package.json +3 -3
- package/pipes/file/file-type.validator.js +6 -4
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(The MIT License)
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2017-
|
|
3
|
+
Copyright (c) 2017-present Kamil Mysliwiec <https://kamilmysliwiec.com>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
6
|
a copy of this software and associated documentation files (the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/common",
|
|
3
|
-
"version": "11.1.
|
|
3
|
+
"version": "11.1.12",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@common)",
|
|
5
5
|
"author": "Kamil Mysliwiec",
|
|
6
6
|
"homepage": "https://nestjs.com",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"file-type": "21.
|
|
21
|
+
"file-type": "21.3.0",
|
|
22
22
|
"iterare": "1.2.1",
|
|
23
23
|
"load-esm": "1.0.3",
|
|
24
24
|
"tslib": "2.8.1",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"optional": true
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "96932ad073cc417e26f0bdea8f58d58145b1ca19"
|
|
42
42
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FileTypeValidator = void 0;
|
|
4
|
+
const url_1 = require("url");
|
|
4
5
|
const logger_service_1 = require("../../services/logger.service");
|
|
5
6
|
const file_validator_interface_1 = require("./file-validator.interface");
|
|
6
7
|
const load_esm_1 = require("load-esm");
|
|
@@ -56,14 +57,15 @@ class FileTypeValidator extends file_validator_interface_1.FileValidator {
|
|
|
56
57
|
return false;
|
|
57
58
|
}
|
|
58
59
|
try {
|
|
59
|
-
let
|
|
60
|
+
let fileTypeModule;
|
|
60
61
|
try {
|
|
61
|
-
|
|
62
|
+
const resolvedPath = require.resolve('file-type');
|
|
63
|
+
fileTypeModule = (0, url_1.pathToFileURL)(resolvedPath).href;
|
|
62
64
|
}
|
|
63
65
|
catch {
|
|
64
|
-
|
|
66
|
+
fileTypeModule = 'file-type';
|
|
65
67
|
}
|
|
66
|
-
const { fileTypeFromBuffer } = await (0, load_esm_1.loadEsm)(
|
|
68
|
+
const { fileTypeFromBuffer } = await (0, load_esm_1.loadEsm)(fileTypeModule);
|
|
67
69
|
const fileType = await fileTypeFromBuffer(file.buffer);
|
|
68
70
|
if (fileType) {
|
|
69
71
|
// Match detected mime type against allowed type
|