eh-api-client
Advanced tools
Comparing version 0.4.0 to 0.5.0
10
index.js
@@ -44,3 +44,4 @@ var | ||
json: true, | ||
qs: {} | ||
qs: {}, | ||
headers: {} | ||
}; | ||
@@ -51,6 +52,6 @@ if(body) { | ||
if(this.lockUUID) { | ||
reqParams.headers = {Authorization: "Lock " + this.lockUUID}; | ||
reqParams.headers.Authorization = "Lock " + this.lockUUID; | ||
} | ||
if(this.internalAuth) { | ||
reqParams.headers = {Authorization: "Internal " + this.internalAuth}; | ||
reqParams.headers.Authorization = "Internal " + this.internalAuth; | ||
} | ||
@@ -76,2 +77,5 @@ if(options.filter) { | ||
} | ||
if(options.range) { | ||
reqParams.headers.Range = options.range; | ||
} | ||
if(options.test) { | ||
@@ -78,0 +82,0 @@ return cb(null, reqParams); |
{ | ||
"name": "eh-api-client", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "Node.js rest client", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -9,3 +9,3 @@ var | ||
describe("Client test", function() { | ||
describe("Internal Auth Client test", function() { | ||
var noteGlobalId = ehGuid.gen(); | ||
@@ -62,2 +62,14 @@ | ||
}); | ||
it("should make a range request", function(done) { | ||
client.get({ | ||
url: "test", | ||
range: "items 0-4", | ||
test: true | ||
}, function(err, req) { | ||
should.not.exists(err); | ||
req.headers.Range.should.equal("items 0-4"); | ||
done(); | ||
}); | ||
}); | ||
}); |
7833
294