Added support for HTTP_PROXY and HTTPS_PROXY environment variables, if the proxy option isn't already set.
Won't use HTTP(S)_PROXY env var if proxy explicitly set to null.
defaults: merge headers
prefer late return statement
[PATCH v2] Add support for gzip content decoding

Support decoding of the gzip Content-Encoding in responses using the
zlib module to decode the response before piping it through the request
object (and therefore before user-connected pipes or body parsing).

Add the boolean option `gzip` to allow users to explicitly
request decoding of supported response content and inclusion of
appropriate content negotiation headers, if unspecified.

This commit favors backwards-compatibility over the increased
performance that transparent compression could provide, although it is
hoped that a future backwards-incompatible version can make transparent
compression the default.

Some major tradeoffs of transparent compression are:

- It may trigger changes in server behavior and performance (for better
  or worse) that are unexpected, either due to buggy servers or
  intermediate network hardware.
- The compression is not fully transparent as users who attach to the
  `data` event of the response (rather than the `data` event of
  `request`) will get gzipped data rather than uncompressed data.
+ It is likely a big win for most users (both current and future) who
  would otherwise be unaware or unable to spend the time to implement
  content negotiation and decoding.  Especially given the prevalence of
  highly-compressible text content (e.g. JSON and XML) and widespread
  server support for gzip.

Changes since v1:
- Rename `decodeContent` option to `gzip` to match option name in 3.0

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
check for content-length header before setting it in nextTick
Merge pull request #951 from kevinoid/content-decoding

Add support for gzip content decoding
Silence EventEmitter memory leak warning #311

When performing a lot of concurrent requests on a keep-alive connection, a lot of error handlers can be added, which in turn will result in the following warning: "possible EventEmitter memory leak detected. 11 listeners added". This isn't really a memory leak and should just be silenced.
Merge pull request #955 from camilleanne/master

check for content-length header before setting it in nextTick
Merge pull request #957 from watson/master

Silence EventEmitter memory leak warning #311
Fixing for 0.8
2.37.0
2.37.1
Merge pull request #946 from aj0strow/merge-default-headers

defaults: merge headers
Merge pull request #844 from jvmccarthy/issue595_http_proxy_env_vars

Add support for HTTP[S]_PROXY environment variables.  Fixes #595.
Add async Content-Length computation when using form-data
Related to #345 #396 #522