flex-combo
Advanced tools
Comparing version 0.11.0 to 0.11.1
48
api.js
@@ -10,8 +10,5 @@ var urlLib = require("url"); | ||
var DAC = require("dac"); | ||
var fetch = require("fetch-agent"); | ||
var isUtf8 = DAC.isUtf8; | ||
var iconv = DAC.iconv; | ||
var ALProtocol = { | ||
"http:": require("http"), | ||
"https:": require("https") | ||
}; | ||
@@ -26,3 +23,3 @@ var ENGINES = []; | ||
this.res = null; | ||
this.engines = ENGINES.map(function(i) { | ||
this.engines = ENGINES.map(function (i) { | ||
return i; | ||
@@ -101,3 +98,3 @@ }); | ||
this.query = merge.recursive(true, this.query, req.query || {}); | ||
this.query = merge.recursive(true, this.query, (req.body || req.query || {})); | ||
@@ -288,30 +285,17 @@ this.HOST = (req.protocol || "http") + "://" + (req.hostname || req.host || req.headers.host); | ||
if (requestOption) { | ||
ALProtocol[requestOption.protocol] | ||
.request(requestOption, function (nsres) { | ||
var buffer = []; | ||
nsres | ||
.on("error", function () { | ||
self.result[_url] = new Buffer("/* " + _url + " Fetch ERROR! */"); | ||
Helper.Log.error(_url); | ||
next(); | ||
}) | ||
.on("data", function (chunk) { | ||
buffer.push(chunk); | ||
}) | ||
.on("end", function () { | ||
var buff = Buffer.concat(buffer); | ||
self.cacheFile(_url, buff); | ||
self.result[_url] = buff; | ||
if (self.param.traceRule && self.param.traceRule.test("Remote " + _url)) { | ||
Helper.Log.remote(_url, requestOption); | ||
} | ||
next(); | ||
}); | ||
}) | ||
.on("error", function () { | ||
self.result[_url] = new Buffer("/* " + _url + " Request ERROR! */"); | ||
fetch.request(requestOption, function (e, buff) { | ||
if (e) { | ||
self.result[_url] = new Buffer("/* " + _url + " " + e.code + "! */"); | ||
Helper.Log.error(_url); | ||
next(); | ||
}) | ||
.end(); | ||
} | ||
else { | ||
self.cacheFile(_url, buff); | ||
self.result[_url] = buff; | ||
if (self.param.traceRule && self.param.traceRule.test("Remote " + _url)) { | ||
Helper.Log.remote(_url, requestOption); | ||
} | ||
next(); | ||
} | ||
}); | ||
} | ||
@@ -318,0 +302,0 @@ else { |
{ | ||
"name": "flex-combo", | ||
"version": "0.11.0", | ||
"version": "0.11.1", | ||
"description": "A combo tool designed for web front-end developer, which support various kinds of combo format by modify configuration(eg. yahoo combo).", | ||
@@ -14,2 +14,3 @@ "main": "index.js", | ||
"dac": "~0.5.1", | ||
"fetch-agent": "~0.2.1", | ||
"mace": "~2.0.0", | ||
@@ -16,0 +17,0 @@ "merge": "~1.2.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
3
51044
10
684
+ Addedfetch-agent@~0.2.1
+ Addedfetch-agent@0.2.4(transitive)