@azteam/express 1.2.365 → 1.2.370

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
@@ -134,10 +134,9 @@ var Server = /*#__PURE__*/function () {
134
134
  app.use((0, _cors["default"])(function (req, callback) {
135
135
  var origin = req.header('Origin'),
136
136
  authorization = req.header('Authorization'),
137
- agent = req.header('User-Agent'),
138
- balancing = req.header('X-LOAD-BALANCING');
137
+ agent = req.header('User-Agent');
139
138
  var error = null;
140
- if (!authorization && !agent.startsWith(SYSTEM_USER) && !balancing.startsWith(SYSTEM_USER)) {
139
+ if (!authorization && !agent.startsWith(SYSTEM_USER)) {
141
140
  if (!origin) {
142
141
  if (!IS_ALLOW_EMPTY) {
143
142
  error = new _error.ErrorException(_error.CORS, "Not allowed by CORS");
@@ -320,7 +319,7 @@ var Server = /*#__PURE__*/function () {
320
319
  case 0:
321
320
  return _context3.abrupt("return", res.success(_objectSpread(_objectSpread({}, req.trackDevice), {}, {
322
321
  host: req.hostname,
323
- origin: req.get('origin')
322
+ origin: req.rootOrigin
324
323
  })));
325
324
  case 1:
326
325
  case "end":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azteam/express",
3
- "version": "1.2.365",
3
+ "version": "1.2.370",
4
4
  "license": "MIT",
5
5
  "author": "toda <sp.azsolution.net@gmail.com>",
6
6
  "main": "./lib/index.js",
package/src/Server.js CHANGED
@@ -116,11 +116,10 @@ class Server {
116
116
  cors(function (req, callback) {
117
117
  const origin = req.header('Origin'),
118
118
  authorization = req.header('Authorization'),
119
- agent = req.header('User-Agent'),
120
- balancing = req.header('X-LOAD-BALANCING');
119
+ agent = req.header('User-Agent');
121
120
 
122
121
  let error = null;
123
- if (!authorization && !agent.startsWith(SYSTEM_USER) && !balancing.startsWith(SYSTEM_USER)) {
122
+ if (!authorization && !agent.startsWith(SYSTEM_USER)) {
124
123
  if (!origin) {
125
124
  if (!IS_ALLOW_EMPTY) {
126
125
  error = new ErrorException(CORS, `Not allowed by CORS`);
@@ -300,7 +299,7 @@ class Server {
300
299
  return res.success({
301
300
  ...req.trackDevice,
302
301
  host: req.hostname,
303
- origin: req.get('origin'),
302
+ origin: req.rootOrigin,
304
303
  });
305
304
  });
306
305