@midwayjs/express 3.4.4 → 3.4.9
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/dist/configuration.js
CHANGED
|
@@ -27,10 +27,12 @@ let ExpressConfiguration = class ExpressConfiguration {
|
|
|
27
27
|
var _a, _b;
|
|
28
28
|
const keys = (_a = this.configService.getConfiguration('express.keys')) !== null && _a !== void 0 ? _a : this.configService.getConfiguration('keys');
|
|
29
29
|
const cookieParserConfig = this.configService.getConfiguration('cookieParser');
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
.
|
|
33
|
-
|
|
30
|
+
if (cookieParserConfig.enable) {
|
|
31
|
+
// add cookie parser middleware
|
|
32
|
+
this.expressFramework
|
|
33
|
+
.getMiddleware()
|
|
34
|
+
.insertFirst(cookieParser((_b = cookieParserConfig.secret) !== null && _b !== void 0 ? _b : keys, cookieParserConfig.options));
|
|
35
|
+
}
|
|
34
36
|
// add body parser
|
|
35
37
|
const bodyparserConfig = this.configService.getConfiguration('bodyParser');
|
|
36
38
|
if (bodyparserConfig.enable) {
|
|
@@ -44,6 +44,10 @@ let MidwayExpressMiddlewareService = class MidwayExpressMiddlewareService {
|
|
|
44
44
|
const classMiddleware = await this.applicationContext.getAsync(fn);
|
|
45
45
|
if (classMiddleware) {
|
|
46
46
|
fn = await classMiddleware.resolve(app);
|
|
47
|
+
if (!fn) {
|
|
48
|
+
// for middleware enabled
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
47
51
|
// wrap async middleware
|
|
48
52
|
fn = wrapAsyncHandler(fn);
|
|
49
53
|
if (!classMiddleware.match && !classMiddleware.ignore) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/express",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.9",
|
|
4
4
|
"description": "Midway Web Framework for Express",
|
|
5
5
|
"main": "dist/index",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@midwayjs/decorator": "^3.4.4",
|
|
28
28
|
"@midwayjs/logger": "^2.15.0",
|
|
29
|
-
"@midwayjs/mock": "^3.4.
|
|
29
|
+
"@midwayjs/mock": "^3.4.9",
|
|
30
30
|
"@types/body-parser": "1.19.2",
|
|
31
31
|
"@types/express": "4.17.13",
|
|
32
32
|
"fs-extra": "10.0.1"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@midwayjs/core": "^3.4.
|
|
36
|
-
"@midwayjs/express-session": "^3.4.
|
|
35
|
+
"@midwayjs/core": "^3.4.9",
|
|
36
|
+
"@midwayjs/express-session": "^3.4.9",
|
|
37
37
|
"body-parser": "1.20.0",
|
|
38
38
|
"cookie-parser": "^1.4.6",
|
|
39
39
|
"express": "4.18.1"
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"engines": {
|
|
47
47
|
"node": ">=12"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "bc8113cff70d88a31e44bde69c395f61a7de2045"
|
|
50
50
|
}
|