|
|
@ -1015,7 +1015,7 @@ function ClientRequest(options, cb) { |
|
|
|
if (options.port && +options.port !== options.defaultPort) { |
|
|
|
hostHeader += ':' + options.port; |
|
|
|
} |
|
|
|
this.setHeader("Host", hostHeader); |
|
|
|
this.setHeader('Host', hostHeader); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -1032,9 +1032,11 @@ function ClientRequest(options, cb) { |
|
|
|
} |
|
|
|
|
|
|
|
if (Array.isArray(options.headers)) { |
|
|
|
self._storeHeader(self.method + ' ' + self.path + ' HTTP/1.1\r\n', options.headers); |
|
|
|
self._storeHeader(self.method + ' ' + self.path + ' HTTP/1.1\r\n', |
|
|
|
options.headers); |
|
|
|
} else if (self.getHeader('expect')) { |
|
|
|
self._storeHeader(self.method + ' ' + self.path + ' HTTP/1.1\r\n', self._renderHeaders()); |
|
|
|
self._storeHeader(self.method + ' ' + self.path + ' HTTP/1.1\r\n', |
|
|
|
self._renderHeaders()); |
|
|
|
} |
|
|
|
if (self.socketPath) { |
|
|
|
self._last = true; |
|
|
@ -1060,9 +1062,9 @@ function ClientRequest(options, cb) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
self._deferToConnect(null, null, function () { |
|
|
|
self._deferToConnect(null, null, function() { |
|
|
|
self._flush(); |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
util.inherits(ClientRequest, OutgoingMessage); |
|
|
@ -1095,7 +1097,7 @@ function createHangUpError() { |
|
|
|
|
|
|
|
ClientRequest.prototype.onSocket = function(socket) { |
|
|
|
var req = this; |
|
|
|
process.nextTick(function () { |
|
|
|
process.nextTick(function() { |
|
|
|
var parser = parsers.alloc(); |
|
|
|
req.socket = socket; |
|
|
|
req.connection = socket; |
|
|
|