Skip to content

Commit 24e6277

Browse files
committed
修正 nodejs 中 UA 头 version 未定义。
1 parent f1ab941 commit 24e6277

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/browserify-wrapper/ajax.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55

66
'use strict';
77

8-
var http = require('http');
9-
var https = require('https');
10-
var url = require('url');
8+
const http = require('http');
9+
const https = require('https');
10+
const url = require('url');
1111

12-
var Promise = require('../promise');
12+
const Promise = require('../promise');
13+
const VERSION = require('../version');
1314

1415
// `keepAlive` option only work on Node.js 0.12+
1516
var httpAgent = new http.Agent({keepAlive: true});
@@ -43,7 +44,7 @@ module.exports = function _ajax(method, resourceUrl, data, success, error) {
4344
agent: transportAgent,
4445
headers: {
4546
'Content-Type': 'text/plain',
46-
'User-Agent': 'AV/' + AV.version + ' (Node.js' + process.version + ')'
47+
'User-Agent': 'AV/' + VERSION + ' (Node.js' + process.version + ')'
4748
}
4849
});
4950

@@ -78,4 +79,4 @@ module.exports = function _ajax(method, resourceUrl, data, success, error) {
7879
success: success,
7980
error: error
8081
});
81-
}
82+
};

0 commit comments

Comments
 (0)