@midwayjs/http-proxy 3.5.3 → 3.7.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.
- package/dist/configuration.js +4 -5
- package/dist/middleware.js +7 -7
- package/package.json +10 -11
package/dist/configuration.js
CHANGED
|
@@ -10,9 +10,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.HttpProxyConfiguration = void 0;
|
|
13
|
-
const decorator_1 = require("@midwayjs/decorator");
|
|
14
|
-
const DefaultConfig = require("./config/config.default");
|
|
15
13
|
const core_1 = require("@midwayjs/core");
|
|
14
|
+
const DefaultConfig = require("./config/config.default");
|
|
16
15
|
const middleware_1 = require("./middleware");
|
|
17
16
|
let HttpProxyConfiguration = class HttpProxyConfiguration {
|
|
18
17
|
async onReady() {
|
|
@@ -26,15 +25,15 @@ let HttpProxyConfiguration = class HttpProxyConfiguration {
|
|
|
26
25
|
}
|
|
27
26
|
};
|
|
28
27
|
__decorate([
|
|
29
|
-
(0,
|
|
28
|
+
(0, core_1.Inject)(),
|
|
30
29
|
__metadata("design:type", core_1.MidwayApplicationManager)
|
|
31
30
|
], HttpProxyConfiguration.prototype, "applicationManager", void 0);
|
|
32
31
|
__decorate([
|
|
33
|
-
(0,
|
|
32
|
+
(0, core_1.Config)('httpProxy'),
|
|
34
33
|
__metadata("design:type", Object)
|
|
35
34
|
], HttpProxyConfiguration.prototype, "httpProxy", void 0);
|
|
36
35
|
HttpProxyConfiguration = __decorate([
|
|
37
|
-
(0,
|
|
36
|
+
(0, core_1.Configuration)({
|
|
38
37
|
namespace: 'upload',
|
|
39
38
|
importConfigs: [
|
|
40
39
|
{
|
package/dist/middleware.js
CHANGED
|
@@ -10,11 +10,11 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.HttpProxyMiddleware = void 0;
|
|
13
|
-
const
|
|
14
|
-
const
|
|
13
|
+
const core_1 = require("@midwayjs/core");
|
|
14
|
+
const axios = require("axios");
|
|
15
15
|
let HttpProxyMiddleware = class HttpProxyMiddleware {
|
|
16
16
|
resolve(app) {
|
|
17
|
-
if (app.getFrameworkType() ===
|
|
17
|
+
if (app.getFrameworkType() === core_1.MidwayFrameworkType.WEB_EXPRESS) {
|
|
18
18
|
return async (req, res, next) => {
|
|
19
19
|
return this.execProxy(req, req, res, next, true);
|
|
20
20
|
};
|
|
@@ -67,7 +67,7 @@ let HttpProxyMiddleware = class HttpProxyMiddleware {
|
|
|
67
67
|
.join('&');
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
const proxyResponse = await (
|
|
70
|
+
const proxyResponse = await axios(reqOptions).catch(err => {
|
|
71
71
|
if (!err || !err.response) {
|
|
72
72
|
throw err || new Error('proxy unknown error');
|
|
73
73
|
}
|
|
@@ -139,15 +139,15 @@ let HttpProxyMiddleware = class HttpProxyMiddleware {
|
|
|
139
139
|
}
|
|
140
140
|
};
|
|
141
141
|
__decorate([
|
|
142
|
-
(0,
|
|
142
|
+
(0, core_1.Config)('httpProxy'),
|
|
143
143
|
__metadata("design:type", Object)
|
|
144
144
|
], HttpProxyMiddleware.prototype, "httpProxy", void 0);
|
|
145
145
|
__decorate([
|
|
146
|
-
(0,
|
|
146
|
+
(0, core_1.Logger)(),
|
|
147
147
|
__metadata("design:type", Object)
|
|
148
148
|
], HttpProxyMiddleware.prototype, "logger", void 0);
|
|
149
149
|
HttpProxyMiddleware = __decorate([
|
|
150
|
-
(0,
|
|
150
|
+
(0, core_1.Middleware)()
|
|
151
151
|
], HttpProxyMiddleware);
|
|
152
152
|
exports.HttpProxyMiddleware = HttpProxyMiddleware;
|
|
153
153
|
//# sourceMappingURL=middleware.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/http-proxy",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"description": "Midway Component for http proxy",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -26,17 +26,16 @@
|
|
|
26
26
|
},
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"axios": "
|
|
29
|
+
"axios": "1.1.3"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@midwayjs/core": "^3.
|
|
33
|
-
"@midwayjs/
|
|
34
|
-
"@midwayjs/
|
|
35
|
-
"@midwayjs/
|
|
36
|
-
"@midwayjs/
|
|
37
|
-
"@midwayjs/
|
|
38
|
-
"@midwayjs/
|
|
39
|
-
"@midwayjs/web": "^3.5.3"
|
|
32
|
+
"@midwayjs/core": "^3.7.0",
|
|
33
|
+
"@midwayjs/express": "^3.7.0",
|
|
34
|
+
"@midwayjs/faas": "^3.7.0",
|
|
35
|
+
"@midwayjs/koa": "^3.7.0",
|
|
36
|
+
"@midwayjs/mock": "^3.7.0",
|
|
37
|
+
"@midwayjs/serverless-app": "^3.7.0",
|
|
38
|
+
"@midwayjs/web": "^3.7.0"
|
|
40
39
|
},
|
|
41
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "99386083ee26b386fd508b9c892091c914e77535"
|
|
42
41
|
}
|