@midwayjs/express 3.10.13 → 3.11.0

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.
@@ -38,7 +38,7 @@ let MidwayExpressMiddlewareService = class MidwayExpressMiddlewareService {
38
38
  if (core_1.Types.isClass(fn) || typeof fn === 'string') {
39
39
  if (typeof fn === 'string' &&
40
40
  !this.applicationContext.hasDefinition(fn)) {
41
- throw new core_1.MidwayCommonError('Middleware definition not found in midway container');
41
+ throw new core_1.MidwayCommonError(`Middleware definition of "${fn}" not found in midway container`);
42
42
  }
43
43
  const classMiddleware = await this.applicationContext.getAsync(fn);
44
44
  if (classMiddleware) {
@@ -60,6 +60,7 @@ let MidwayExpressMiddlewareService = class MidwayExpressMiddlewareService {
60
60
  const match = (0, core_1.pathMatching)({
61
61
  match: classMiddleware.match,
62
62
  ignore: classMiddleware.ignore,
63
+ thisResolver: classMiddleware,
63
64
  });
64
65
  fn = (req, res, next) => {
65
66
  if (!match(req))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/express",
3
- "version": "3.10.13",
3
+ "version": "3.11.0",
4
4
  "description": "Midway Web Framework for Express",
5
5
  "main": "dist/index",
6
6
  "typings": "index.d.ts",
@@ -25,15 +25,15 @@
25
25
  "license": "MIT",
26
26
  "devDependencies": {
27
27
  "@midwayjs/logger": "^2.15.0",
28
- "@midwayjs/mock": "^3.10.13",
28
+ "@midwayjs/mock": "^3.11.0",
29
29
  "@types/body-parser": "1.19.2",
30
30
  "@types/express": "4.17.17",
31
31
  "fs-extra": "10.1.0"
32
32
  },
33
33
  "dependencies": {
34
- "@midwayjs/core": "^3.10.10",
35
- "@midwayjs/express-session": "^3.10.13",
36
- "body-parser": "1.20.1",
34
+ "@midwayjs/core": "^3.11.0",
35
+ "@midwayjs/express-session": "^3.11.0",
36
+ "body-parser": "1.20.2",
37
37
  "cookie-parser": "^1.4.6",
38
38
  "express": "4.18.2"
39
39
  },
@@ -45,5 +45,5 @@
45
45
  "engines": {
46
46
  "node": ">=12"
47
47
  },
48
- "gitHead": "6052ab52c7973f092a4acc943707d7b4cac16bd2"
48
+ "gitHead": "eadb977e7fddcd4287c099fc32b601cd51702514"
49
49
  }