eh-api-client
Advanced tools
Comparing version 0.8.5 to 0.8.6
@@ -81,3 +81,3 @@ var | ||
}; | ||
if(body) { | ||
if(body && !body._read) { | ||
reqParams.body = body; | ||
@@ -130,3 +130,3 @@ } | ||
} | ||
request(reqParams, function(err, res, data) { | ||
var req = request(reqParams, function(err, res, data) { | ||
_res = res; | ||
@@ -141,2 +141,5 @@ if(err) { | ||
}); | ||
if(body && body._read) { | ||
body.pipe(req); | ||
} | ||
return deferred.promise; | ||
@@ -143,0 +146,0 @@ }; |
{ | ||
"name": "eh-api-client", | ||
"version": "0.8.5", | ||
"version": "0.8.6", | ||
"description": "Node.js rest client", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
var | ||
Factory = require("../index"), | ||
should = require("should"), | ||
ehGuid = require("eh-guid"); | ||
ehGuid = require("eh-guid"), | ||
fs = require("fs"); | ||
@@ -10,4 +11,4 @@ var f = new Factory("http://localhost:3000"); | ||
describe("Test factory methods", function(done) { | ||
it("get", function() { | ||
describe("Test factory methods", function() { | ||
it("get", function(done) { | ||
f.get({ | ||
@@ -19,2 +20,13 @@ test: true, | ||
done(); | ||
}).done(); | ||
}); | ||
it("send readable stream", function(done) { | ||
var stream = fs.createReadStream(__filename); | ||
f.post({ | ||
test: true, | ||
url: "test" | ||
}, stream, function(err, res) { | ||
should.not.exists(res.body); | ||
done(); | ||
}); | ||
@@ -34,3 +46,4 @@ }); | ||
res.headers.should.eql(headers); | ||
}).done(done); | ||
done(); | ||
}).done(); | ||
}); | ||
@@ -57,3 +70,3 @@ }); | ||
it("get notes", function(done) { | ||
it("get notes list", function(done) { | ||
client.get("/notes/", function(err, data) { | ||
@@ -91,3 +104,3 @@ should.not.exists(err); | ||
done(); | ||
}); | ||
}).done(); | ||
}); | ||
@@ -94,0 +107,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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
9696
351
1