From db01707e1368084c4342b3ed62d26a6073f3302b Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 29 Jun 2018 02:20:07 -0600 Subject: [PATCH] return correct obj and ws --- index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index f6fd1a2..22585d3 100644 --- a/index.js +++ b/index.js @@ -213,11 +213,16 @@ function setDefaults(defs) { if ('unix' !== (obj.hostname||obj.host||'').toLowerCase()) { return obj; } - obj.hostname = null; + + obj.href = null; + obj.hostname = obj.host = null; + paths = (obj.pathname||obj.path||'').split(':'); + obj.socketPath = paths.shift(); obj.pathname = obj.path = paths.join(':'); - obj.href = null; + + return obj; } function urequest(opts, cb) {