@azteam/express 1.2.321 → 1.2.323
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 +4 -4
- package/package.json +1 -1
- package/src/Server.js +2 -3
package/lib/Server.js
CHANGED
|
@@ -142,12 +142,12 @@ 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) {
|
|
146
|
+
return origin.endsWith(re);
|
|
147
|
+
})) {
|
|
148
|
+
error = new _error.ErrorException(_error.CORS, "".concat(origin, " Not allowed by CORS"));
|
|
145
149
|
}
|
|
146
|
-
// else if (!WHITE_LIST.some((re) => origin.endsWith(re))) {
|
|
147
|
-
// error = new ErrorException(CORS, `${origin} Not allowed by CORS`);
|
|
148
|
-
// }
|
|
149
150
|
}
|
|
150
|
-
|
|
151
151
|
callback(error, {
|
|
152
152
|
credentials: true,
|
|
153
153
|
origin: true
|
package/package.json
CHANGED
package/src/Server.js
CHANGED
|
@@ -125,10 +125,9 @@ 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))) {
|
|
129
|
+
error = new ErrorException(CORS, `${origin} Not allowed by CORS`);
|
|
128
130
|
}
|
|
129
|
-
// else if (!WHITE_LIST.some((re) => origin.endsWith(re))) {
|
|
130
|
-
// error = new ErrorException(CORS, `${origin} Not allowed by CORS`);
|
|
131
|
-
// }
|
|
132
131
|
}
|
|
133
132
|
callback(error, {
|
|
134
133
|
credentials: true,
|