aboutsummaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/request/request.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/request/request.js')
-rw-r--r--deps/npm/node_modules/request/request.js30
1 files changed, 19 insertions, 11 deletions
diff --git a/deps/npm/node_modules/request/request.js b/deps/npm/node_modules/request/request.js
index 700b9e0a92..af91a11d3b 100644
--- a/deps/npm/node_modules/request/request.js
+++ b/deps/npm/node_modules/request/request.js
@@ -256,17 +256,7 @@ Request.prototype.init = function (options) {
// Support Unix Sockets
if (self.uri.host === 'unix') {
- // Get the socket & request paths from the URL
- var unixParts = self.uri.path.split(':')
- , host = unixParts[0]
- , path = unixParts[1]
- // Apply unix properties to request
- self.socketPath = host
- self.uri.pathname = path
- self.uri.path = path
- self.uri.host = host
- self.uri.hostname = host
- self.uri.isUnix = true
+ self.enableUnixSocket()
}
if (self.strictSSL === false) {
@@ -1163,6 +1153,10 @@ Request.prototype.qs = function (q, clobber) {
self.url = self.uri
self.path = self.uri.path
+ if (self.uri.host === 'unix') {
+ self.enableUnixSocket()
+ }
+
return self
}
Request.prototype.form = function (form) {
@@ -1246,6 +1240,20 @@ Request.prototype.getHeader = function (name, headers) {
})
return result
}
+Request.prototype.enableUnixSocket = function () {
+ // Get the socket & request paths from the URL
+ var unixParts = this.uri.path.split(':')
+ , host = unixParts[0]
+ , path = unixParts[1]
+ // Apply unix properties to request
+ this.socketPath = host
+ this.uri.pathname = path
+ this.uri.path = path
+ this.uri.host = host
+ this.uri.hostname = host
+ this.uri.isUnix = true
+}
+
Request.prototype.auth = function (user, pass, sendImmediately, bearer) {
var self = this