pkrumins/nodejs-proxy — pull request #12 by jtlebi (2011-11-20 15:14:46+00:00)
Title: WGET bug workaround

WGET is an HTTP1.0 client using HTTP1.1 headers. Node.js is not able to forward HTTP1.0 request and replaces them by HTTP1.1 which has the effect of enabling "transfer-encoding: chunked" by default. Sadly HTTP1.0 client doesn't support it.

This commit adds code to detect such situations. In this case, the answer is cached in memory before being forwarded to the client with the addition of "Content-length" header in order to cancel the "transfer-encoding: chunked".