http, https: don't depend on `globalAgent`
authorNathan Rajlich <nathan@tootallnate.net>
Tue, 25 Feb 2014 22:15:02 +0000 (14:15 -0800)
committerNathan Rajlich <nathan@tootallnate.net>
Wed, 26 Feb 2014 21:18:54 +0000 (13:18 -0800)
commitd6bbb19f1d1d6397d862d09304bc63c476f675c1
tree7d371831c0d769125d5b4c062c69783ee697f283
parentd307bebec4a7b087e4bb3576665235e4ab086a60
http, https: don't depend on `globalAgent`

For the `request()` and `get()` functions. I could never
really understand why these two functions go through agent
first... Especially since the user could be passing `agent: false`
or a different Agent instance completely, in which `globalAgent`
will be completely bypassed.

Moved the relevant logic from `Agent#request()` into the
`ClientRequest` constructor.

Incidentally, this commit fixes #7012 (which was the original
intent of this commit).
lib/_http_client.js
lib/http.js
lib/https.js