sparc-commons
Advanced tools
Comparing version 0.2.20 to 0.2.21
@@ -67,3 +67,3 @@ /*jshint multistr: true */ | ||
} else { | ||
_.set(requestOpts, 'headers', headers) | ||
_.set(requestOpts, 'headers', _.get(resource, 'headers', {})) | ||
} | ||
@@ -76,4 +76,14 @@ | ||
data = requestStream; | ||
} else if(_.get(opts, 'query')){ | ||
url += parseQuery(opts.query) | ||
} else if(_.has(opts, 'query')){ | ||
if(_.keys(data).length === 0){ | ||
data = null | ||
} | ||
if(resource.method.toUpperCase() === 'GET'){ | ||
var q = {} | ||
_.merge(q, opts.query, data) | ||
url += parseQuery(q) | ||
data = null | ||
} else { | ||
url += parseQuery(opts.query) | ||
} | ||
} | ||
@@ -80,0 +90,0 @@ |
{ | ||
"name": "sparc-commons", | ||
"version": "0.2.20", | ||
"version": "0.2.21", | ||
"description": "Library with all small time common stuff used across the SPARC echosystem", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -41,2 +41,3 @@ var nock = require('nock'); | ||
apikey: "asdfg", | ||
pippo: "pluto", | ||
paperino: 'topolino' | ||
@@ -71,3 +72,4 @@ }) | ||
apikey: "asdfg", | ||
paperino: 'topolino' | ||
paperino: 'topolino', | ||
pippo: 'pluto' | ||
}) | ||
@@ -74,0 +76,0 @@ .reply(200, "Hallo"); |
1218
50140
14