@midwayjs/koa 3.20.4 → 3.20.11
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.
|
@@ -18,6 +18,12 @@ export declare const keys = "";
|
|
|
18
18
|
* @property {Boolean} httpOnly - httpOnly property, defaults is true
|
|
19
19
|
*/
|
|
20
20
|
export declare const cookies: {};
|
|
21
|
+
/**
|
|
22
|
+
* default cookie get options
|
|
23
|
+
*/
|
|
24
|
+
export declare const cookiesExtra: {
|
|
25
|
+
defaultGetOptions: {};
|
|
26
|
+
};
|
|
21
27
|
export declare const onerror: {};
|
|
22
28
|
/**
|
|
23
29
|
* @member Config#bodyParser
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.siteFile = exports.bodyParser = exports.onerror = exports.cookies = exports.keys = exports.koa = void 0;
|
|
3
|
+
exports.siteFile = exports.bodyParser = exports.onerror = exports.cookiesExtra = exports.cookies = exports.keys = exports.koa = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* koa server options
|
|
6
6
|
*/
|
|
@@ -43,6 +43,14 @@ exports.cookies = {
|
|
|
43
43
|
// httpOnly: true | false,
|
|
44
44
|
// sameSite: 'none|lax|strict',
|
|
45
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* default cookie get options
|
|
48
|
+
*/
|
|
49
|
+
exports.cookiesExtra = {
|
|
50
|
+
defaultGetOptions: {
|
|
51
|
+
// sign: false,
|
|
52
|
+
},
|
|
53
|
+
};
|
|
46
54
|
exports.onerror = {};
|
|
47
55
|
/**
|
|
48
56
|
* @member Config#bodyParser
|
package/dist/framework.js
CHANGED
|
@@ -41,6 +41,7 @@ let MidwayKoaFramework = class MidwayKoaFramework extends core_1.BaseFramework {
|
|
|
41
41
|
throw new core_1.MidwayConfigMissingError('config.keys');
|
|
42
42
|
}
|
|
43
43
|
const cookieOptions = this.configService.getConfiguration('cookies');
|
|
44
|
+
const cookieGetOptions = this.configService.getConfiguration('cookiesExtra.defaultGetOptions');
|
|
44
45
|
this.app = new koa({
|
|
45
46
|
keys: [].concat(appKeys),
|
|
46
47
|
proxy: this.configurationOptions.proxy,
|
|
@@ -51,7 +52,7 @@ let MidwayKoaFramework = class MidwayKoaFramework extends core_1.BaseFramework {
|
|
|
51
52
|
Object.defineProperty(this.app.context, 'cookies', {
|
|
52
53
|
get() {
|
|
53
54
|
if (!this[COOKIES]) {
|
|
54
|
-
this[COOKIES] = new cookies_1.Cookies(this, this.app.keys, cookieOptions);
|
|
55
|
+
this[COOKIES] = new cookies_1.Cookies(this, this.app.keys, cookieOptions, cookieGetOptions);
|
|
55
56
|
}
|
|
56
57
|
return this[COOKIES];
|
|
57
58
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/koa",
|
|
3
|
-
"version": "3.20.
|
|
3
|
+
"version": "3.20.11",
|
|
4
4
|
"description": "Midway Web Framework for KOA",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -24,18 +24,18 @@
|
|
|
24
24
|
],
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@midwayjs/mock": "^3.20.
|
|
27
|
+
"@midwayjs/mock": "^3.20.11",
|
|
28
28
|
"@types/koa-router": "7.4.8",
|
|
29
29
|
"fs-extra": "11.3.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@koa/router": "^12.0.0",
|
|
33
|
-
"@midwayjs/cookies": "^1.0
|
|
34
|
-
"@midwayjs/core": "^3.20.
|
|
35
|
-
"@midwayjs/session": "^3.20.
|
|
33
|
+
"@midwayjs/cookies": "^1.3.0",
|
|
34
|
+
"@midwayjs/core": "^3.20.11",
|
|
35
|
+
"@midwayjs/session": "^3.20.11",
|
|
36
36
|
"@types/koa": "2.15.0",
|
|
37
37
|
"@types/qs": "6.9.18",
|
|
38
|
-
"koa": "2.16.
|
|
38
|
+
"koa": "2.16.2",
|
|
39
39
|
"koa-bodyparser": "4.4.1",
|
|
40
40
|
"qs": "6.14.0"
|
|
41
41
|
},
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"engines": {
|
|
48
48
|
"node": ">=12"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "741e5e2cd200d44182bf893f348f58fb5c4e5404"
|
|
51
51
|
}
|