@azteam/express 1.2.246 → 1.2.247

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/Server.js +8 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azteam/express",
3
- "version": "1.2.246",
3
+ "version": "1.2.247",
4
4
  "main": "src/index.js",
5
5
  "engines": {
6
6
  "node": ">= 12.0.0",
package/src/Server.js CHANGED
@@ -46,7 +46,7 @@ class Server {
46
46
  ...options,
47
47
  };
48
48
 
49
- this.cookieOptions = {
49
+ this.cookieOption = {
50
50
  domain: null,
51
51
  path: '/',
52
52
  secure: process.env.NODE_ENV !== 'development',
@@ -68,10 +68,10 @@ class Server {
68
68
  return this;
69
69
  }
70
70
 
71
- setCookieOptions(cookieOptions) {
72
- this.cookieOptions = {
73
- ...this.cookieOptions,
74
- ...cookieOptions,
71
+ setCookieOption(cookieOption) {
72
+ this.cookieOption = {
73
+ ...this.cookieOption,
74
+ ...cookieOption,
75
75
  };
76
76
  return this;
77
77
  }
@@ -130,7 +130,7 @@ class Server {
130
130
  startAPI(port) {
131
131
  if (!_.isEmpty(this.controllers)) {
132
132
  const WHITE_LIST = this.whiteList;
133
- const COOKIE_OPTIONS = this.cookieOptions;
133
+ const COOKIE_OPTION = this.cookieOption;
134
134
  const {isAllowEmptyOrigin} = this.options;
135
135
 
136
136
  const app = express();
@@ -238,7 +238,7 @@ class Server {
238
238
  app.response.cleanCookie = function (data) {
239
239
  _.map(data, (name) => {
240
240
  this.clearCookie(name, {
241
- domain: COOKIE_OPTIONS.domain,
241
+ domain: COOKIE_OPTION.domain,
242
242
  });
243
243
  });
244
244
  };
@@ -247,7 +247,7 @@ class Server {
247
247
  _.map(data, (value, key) => {
248
248
  const maxAge = 86400000 * 365; // 1 year
249
249
  this.cookie(key, value, {
250
- ...COOKIE_OPTIONS,
250
+ ...COOKIE_OPTION,
251
251
  maxAge,
252
252
  expires: new Date(Date.now() + maxAge),
253
253
  });