@azteam/express 1.2.254 → 1.2.256
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 +3 -2
package/package.json
CHANGED
package/src/Server.js
CHANGED
|
@@ -153,10 +153,10 @@ class Server {
|
|
|
153
153
|
const origin = req.header('Origin');
|
|
154
154
|
const authorization = req.header('Authorization');
|
|
155
155
|
const appSecret = req.header('x-app-secret');
|
|
156
|
+
const agent = req.header('User-Agent');
|
|
156
157
|
|
|
157
158
|
let error = null;
|
|
158
|
-
|
|
159
|
-
if (!authorization && !appSecret) {
|
|
159
|
+
if (!authorization && !appSecret && !agent.startsWith('toda')) {
|
|
160
160
|
if (!origin) {
|
|
161
161
|
if (!isAllowEmptyOrigin) {
|
|
162
162
|
error = new ErrorException(CORS, `Not allowed by CORS`);
|
|
@@ -314,6 +314,7 @@ class Server {
|
|
|
314
314
|
app.get('/track', async function (req, res) {
|
|
315
315
|
return res.success({
|
|
316
316
|
...req.trackDevice,
|
|
317
|
+
host: req.hostname,
|
|
317
318
|
});
|
|
318
319
|
});
|
|
319
320
|
|