@midwayjs/koa 3.2.2 → 3.3.2
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/framework.js +4 -0
- package/dist/interface.d.ts +18 -2
- package/index.d.ts +2 -0
- package/package.json +5 -5
package/dist/framework.js
CHANGED
|
@@ -41,6 +41,10 @@ let MidwayKoaFramework = class MidwayKoaFramework extends core_1.BaseFramework {
|
|
|
41
41
|
const cookieOptions = this.configService.getConfiguration('cookies');
|
|
42
42
|
this.app = new koa({
|
|
43
43
|
keys: [].concat(appKeys),
|
|
44
|
+
proxy: this.configurationOptions.proxy,
|
|
45
|
+
proxyIpHeader: this.configurationOptions.proxyIpHeader,
|
|
46
|
+
subdomainOffset: this.configurationOptions.subdomainOffset,
|
|
47
|
+
maxIpsCount: this.configurationOptions.maxIpsCount,
|
|
44
48
|
});
|
|
45
49
|
Object.defineProperty(this.app.context, 'cookies', {
|
|
46
50
|
get() {
|
package/dist/interface.d.ts
CHANGED
|
@@ -50,6 +50,22 @@ export interface IMidwayKoaConfigurationOptions extends IConfigurationOptions {
|
|
|
50
50
|
* http global prefix
|
|
51
51
|
*/
|
|
52
52
|
globalPrefix?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Trust proxy headers
|
|
55
|
+
*/
|
|
56
|
+
proxy?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Subdomain offset
|
|
59
|
+
*/
|
|
60
|
+
subdomainOffset?: number;
|
|
61
|
+
/**
|
|
62
|
+
* Proxy IP header, defaults to X-Forwarded-For
|
|
63
|
+
*/
|
|
64
|
+
proxyIpHeader?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Max IPs read from proxy IP header, default to 0 (means infinity)
|
|
67
|
+
*/
|
|
68
|
+
maxIpsCount?: number;
|
|
53
69
|
}
|
|
54
70
|
export declare type MiddlewareParamArray = Array<Middleware<DefaultState, IMidwayKoaContext>>;
|
|
55
71
|
export interface IWebMiddleware {
|
|
@@ -92,7 +108,7 @@ export interface BodyParserOptions {
|
|
|
92
108
|
/**
|
|
93
109
|
* custom json request detect function. Default is null
|
|
94
110
|
*/
|
|
95
|
-
detectJSON?: (
|
|
111
|
+
detectJSON?: (ctx: IMidwayKoaContext) => boolean;
|
|
96
112
|
/**
|
|
97
113
|
* support extend types
|
|
98
114
|
*/
|
|
@@ -104,6 +120,6 @@ export interface BodyParserOptions {
|
|
|
104
120
|
/**
|
|
105
121
|
* support custom error handle
|
|
106
122
|
*/
|
|
107
|
-
onerror?: (
|
|
123
|
+
onerror?: (err: Error, ctx: IMidwayKoaContext) => void;
|
|
108
124
|
}
|
|
109
125
|
//# sourceMappingURL=interface.d.ts.map
|
package/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/koa",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.2",
|
|
4
4
|
"description": "Midway Web Framework for KOA",
|
|
5
5
|
"main": "dist/index",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@midwayjs/decorator": "^3.1.6",
|
|
28
28
|
"@midwayjs/logger": "^2.15.0",
|
|
29
|
-
"@midwayjs/mock": "^3.
|
|
29
|
+
"@midwayjs/mock": "^3.3.2",
|
|
30
30
|
"@types/koa": "2.13.4",
|
|
31
31
|
"@types/koa-router": "7.4.4",
|
|
32
32
|
"fs-extra": "10.0.1"
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@koa/router": "^10.0.0",
|
|
36
36
|
"@midwayjs/cookies": "^1.0.2",
|
|
37
|
-
"@midwayjs/core": "^3.
|
|
38
|
-
"@midwayjs/session": "^3.
|
|
37
|
+
"@midwayjs/core": "^3.3.2",
|
|
38
|
+
"@midwayjs/session": "^3.3.2",
|
|
39
39
|
"koa": "2.13.4",
|
|
40
40
|
"koa-bodyparser": "4.3.0"
|
|
41
41
|
},
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"engines": {
|
|
48
48
|
"node": ">=12"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "2c7c235421ba904f8943efe31a71f452089d5d53"
|
|
51
51
|
}
|