docker-modem
Advanced tools
Comparing version 4.0.1 to 5.0.0
@@ -167,3 +167,3 @@ var querystring = require('querystring'), | ||
} | ||
var optionsf = { | ||
@@ -344,3 +344,3 @@ path: address, | ||
var json = utils.parseJSON(result) || stream.Readable.from(buffer); | ||
var json = utils.parseJSON(result) || result; | ||
if (finished === false) { | ||
@@ -381,2 +381,5 @@ finished = true; | ||
getCause(isStream, res, json, function (err, cause) { | ||
if (err) { | ||
return cb(err, null); | ||
} | ||
var msg = new Error( | ||
@@ -404,2 +407,4 @@ '(HTTP code ' + res.statusCode + ') ' + | ||
var chunks = ''; | ||
var done = false; | ||
if (isStream) { | ||
@@ -409,4 +414,7 @@ res.on('data', function (chunk) { | ||
}); | ||
res.on('error', function (err) { | ||
handler(err, null); | ||
}); | ||
res.on('end', function () { | ||
callback(null, utils.parseJSON(chunks) || chunks); | ||
handler(null, utils.parseJSON(chunks) || chunks) | ||
}); | ||
@@ -416,2 +424,13 @@ } else { | ||
} | ||
function handler(err, data) { | ||
if (done === false) { | ||
if (err) { | ||
callback(err); | ||
} else { | ||
callback(null, data); | ||
} | ||
} | ||
done = true; | ||
} | ||
} | ||
@@ -418,0 +437,0 @@ }; |
{ | ||
"name": "docker-modem", | ||
"description": "Docker remote API network layer module.", | ||
"version": "4.0.1", | ||
"version": "5.0.0", | ||
"author": "Pedro Dias <petermdias@gmail.com>", | ||
@@ -6,0 +6,0 @@ "maintainers": [ |
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
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
45320
836