From abf18da4a0c42697cf9b8bb87ef41a9d254f5140 Mon Sep 17 00:00:00 2001 From: Vsevolod Strukchinsky Date: Fri, 16 Oct 2015 20:59:09 +0500 Subject: [PATCH] cleanup unix socket code --- index.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index dec2829..a251e18 100644 --- a/index.js +++ b/index.js @@ -253,19 +253,12 @@ function normalizeArguments(url, opts) { opts.method = opts.method || 'GET'; - // check for unix domain socket if (opts.hostname === 'unix') { - // extract socket path and request path var matches = /(.+)\:(.+)/.exec(opts.path); if (matches) { - var socketPath = matches[1]; - var path = matches[2]; - - // make http.request use unix domain socket - // instead of host:port combination - opts.socketPath = socketPath; - opts.path = path; + opts.socketPath = matches[1]; + opts.path = matches[2]; opts.host = null; } }