@azteam/express 1.2.323 → 1.2.325

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/lib/Server.js CHANGED
@@ -51,7 +51,7 @@ var Server = /*#__PURE__*/function () {
51
51
  this.options = _objectSpread({
52
52
  redis: null,
53
53
  isAllowEmptyOrigin: true,
54
- whiteList: [],
54
+ whiteList: null,
55
55
  cookieOption: {},
56
56
  debug: process.env.NODE_ENV === 'development'
57
57
  }, options);
@@ -142,7 +142,7 @@ var Server = /*#__PURE__*/function () {
142
142
  if (!IS_ALLOW_EMPTY) {
143
143
  error = new _error.ErrorException(_error.CORS, "Not allowed by CORS");
144
144
  }
145
- } else if (!WHITE_LIST.some(function (re) {
145
+ } else if (WHITE_LIST && !WHITE_LIST.some(function (re) {
146
146
  return origin.endsWith(re);
147
147
  })) {
148
148
  error = new _error.ErrorException(_error.CORS, "".concat(origin, " Not allowed by CORS"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azteam/express",
3
- "version": "1.2.323",
3
+ "version": "1.2.325",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./src/index.js",
6
6
  "scripts": {
package/src/Server.js CHANGED
@@ -26,7 +26,7 @@ class Server {
26
26
  this.options = {
27
27
  redis: null,
28
28
  isAllowEmptyOrigin: true,
29
- whiteList: [],
29
+ whiteList: null,
30
30
  cookieOption: {},
31
31
  debug: process.env.NODE_ENV === 'development',
32
32
  ...options,
@@ -125,7 +125,7 @@ class Server {
125
125
  if (!IS_ALLOW_EMPTY) {
126
126
  error = new ErrorException(CORS, `Not allowed by CORS`);
127
127
  }
128
- } else if (!WHITE_LIST.some((re) => origin.endsWith(re))) {
128
+ } else if (WHITE_LIST && !WHITE_LIST.some((re) => origin.endsWith(re))) {
129
129
  error = new ErrorException(CORS, `${origin} Not allowed by CORS`);
130
130
  }
131
131
  }