mikeal/request — pull request #303 by mreinstein (2012-08-21 00:08:22+00:00)
Title: gzip support for HTTP responses

I've found that having to wrap every HTTP response in a zlib wrapper is annoying and clutters my code.
This patch supports gzip automatically, without overwriting people's headers or breaking code running on older node versions.

It does 3 things:

1. checks if zlib support is present in node, and if so adds it.

2. if zlib is present, and self.headers does not contain an Accept-Encoding header, it adds one, with the value set to 'gzip'

3. after the request body is received, if zlib is present, and the Content-Encoding header is present, and if that header's value contains 'gzip', ungzip the body.