Comparing version 4.0.1 to 4.0.2
@@ -35,2 +35,5 @@ const https = require('https'); | ||
pathname = names.slice(0, 2).join('/') + names.slice(2).join('/'); | ||
} else if (cfg.host === 'localhost') { | ||
cfg.port = cfg.port || LOCALPORT; | ||
pathname = names.slice(0, 2).join('/') + names.slice(2).join('/'); | ||
} else { | ||
@@ -42,2 +45,9 @@ cfg.host = names.slice(0, 1).concat(cfg.host).join('.'); | ||
pathname = pathname + '/'; | ||
if (params.__path) { | ||
pathname = pathname + params.__path; | ||
if (!pathname.endsWith('/')) { | ||
pathname = pathname + '/'; | ||
} | ||
delete params.__path; | ||
} | ||
let headers = {}; | ||
@@ -92,3 +102,10 @@ let body; | ||
response; | ||
return callback(new Error(message), response); | ||
let error = new Error(message); | ||
if (response.error && response.error.hasOwnProperty('details')) { | ||
error.details = response.error.details; | ||
} | ||
if (response.error && response.error.hasOwnProperty('type')) { | ||
error.type = response.error.type; | ||
} | ||
return callback(error, response); | ||
} else { | ||
@@ -95,0 +112,0 @@ return callback(null, response, res.headers); |
{ | ||
"name": "lib", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "StdLib: Standard Library for Microservices Node.js Bindings", | ||
@@ -5,0 +5,0 @@ "main": "lib.js", |
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
15209
282