|
@@ -26,6 +26,7 @@ const uuid = require('uuid'); |
|
@@ -26,6 +26,7 @@ const uuid = require('uuid'); |
26
|
const pkg = require('./package.json');
|
26
|
const pkg = require('./package.json');
|
27
|
const hbsEvent = require('./config/hbsevent');
|
27
|
const hbsEvent = require('./config/hbsevent');
|
28
|
const _ = require('lodash');
|
28
|
const _ = require('lodash');
|
|
|
29
|
+const stringProcess = require('./utils/string-process');
|
29
|
|
30
|
|
30
|
const app = express();
|
31
|
const app = express();
|
31
|
|
32
|
|
|
@@ -56,6 +57,7 @@ app.enable('trust proxy'); |
|
@@ -56,6 +57,7 @@ app.enable('trust proxy'); |
56
|
app.disable('x-powered-by');
|
57
|
app.disable('x-powered-by');
|
57
|
|
58
|
|
58
|
app.use((req, res, next) => {
|
59
|
app.use((req, res, next) => {
|
|
|
60
|
+ req.url = stringProcess.decodeURIComponent(req.url) || '/404';// 错误的网址编码重定向404
|
59
|
req.isApmReport = _.get(req.app.locals, 'wap.open.bughd', false); // 把错误上报的开关绑定到上下文,node-lib 库要使用
|
61
|
req.isApmReport = _.get(req.app.locals, 'wap.open.bughd', false); // 把错误上报的开关绑定到上下文,node-lib 库要使用
|
60
|
next();
|
62
|
next();
|
61
|
});
|
63
|
});
|
|
@@ -189,4 +191,3 @@ app.listen(config.port, function() { |
|
@@ -189,4 +191,3 @@ app.listen(config.port, function() { |
189
|
}
|
191
|
}
|
190
|
});
|
192
|
});
|
191
|
}); |
193
|
}); |
192
|
- |
|
|