Skip to content

Commit 5cd5dd4

Browse files
committed
https-proxy-agent: hoist out the common "hostname" string logic
1 parent f8134f4 commit 5cd5dd4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

https-proxy-agent.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,9 @@ HttpsProxyAgent.prototype.createConnection = function (opts, fn) {
9292
socket.once('data', ondata);
9393
}
9494

95-
var msg = 'CONNECT ' + opts.host + ':' + opts.port + ' HTTP/1.1\r\n' +
96-
'Host: ' + opts.host + ':' + opts.port + '\r\n' +
95+
var hostname = opts.host + ':' + opts.port;
96+
var msg = 'CONNECT ' + hostname + ' HTTP/1.1\r\n' +
97+
'Host: ' + hostname + '\r\n' +
9798
'\r\n';
9899
socket.write(msg);
99100
};

0 commit comments

Comments
 (0)