Commit ea22f86a authored by liuwei's avatar liuwei

正则 优化

parent 3948b207
......@@ -78,11 +78,11 @@ module.exports = function (options) {
debug(option)
if (!option.agent && !/^https/.test(option.uri)) {
option.agent = httpAgent
} else if (!option.agent && /^https/.test(option.uri)) {
option.agent = httpsAgent
}
// if (!option.agent && !/^https/.test(option.uri)) {
option.agent = (option && option.uri && option.uri.indexOf('https') != -1) ? httpsAgent : httpAgent
// } else if (!option.agent && /^https/.test(option.uri)) {
// option.agent = httpsAgent
// }
return new Promise(function (resolve, reject) {
request(option, function (err, response, body) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment