add missing ua compatibility api
This commit is contained in:
parent
ec9ffbd6ba
commit
c4814f6a9e
1 changed files with 5 additions and 0 deletions
5
app.js
5
app.js
|
|
@ -414,6 +414,11 @@ function handleVersion(req, res, next) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleOptions(req, res, next) {
|
function handleOptions(req, res, next) {
|
||||||
|
try {
|
||||||
|
req.app.ua = agent.parse(req.headers['user-agent'] || '');
|
||||||
|
} catch (e) {
|
||||||
|
logger.log("ua parse error on : "+req.headers['user-agent']);
|
||||||
|
}
|
||||||
if (req.method === 'OPTIONS') {
|
if (req.method === 'OPTIONS') {
|
||||||
addCorsHeaders(req, res);
|
addCorsHeaders(req, res);
|
||||||
res.end();
|
res.end();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue