@azteam/express 1.2.251 → 1.2.253
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/package.json +1 -1
- package/src/Server.js +6 -2
package/package.json
CHANGED
package/src/Server.js
CHANGED
|
@@ -152,10 +152,11 @@ class Server {
|
|
|
152
152
|
cors(function (req, callback) {
|
|
153
153
|
const origin = req.header('Origin');
|
|
154
154
|
const authorization = req.header('Authorization');
|
|
155
|
+
const appSecret = req.header('x-app-secret');
|
|
155
156
|
|
|
156
157
|
let error = null;
|
|
157
158
|
|
|
158
|
-
if (!authorization) {
|
|
159
|
+
if (!authorization && !appSecret) {
|
|
159
160
|
if (!origin) {
|
|
160
161
|
if (!isAllowEmptyOrigin) {
|
|
161
162
|
error = new ErrorException(CORS, `Not allowed by CORS`);
|
|
@@ -164,7 +165,10 @@ class Server {
|
|
|
164
165
|
error = new ErrorException(CORS, `${origin} Not allowed by CORS`);
|
|
165
166
|
}
|
|
166
167
|
}
|
|
167
|
-
callback(error,
|
|
168
|
+
callback(error, {
|
|
169
|
+
credentials: true,
|
|
170
|
+
origin: true,
|
|
171
|
+
});
|
|
168
172
|
})
|
|
169
173
|
);
|
|
170
174
|
|