http: send Content-Length when possible
authorChristian Tellnes <christian@tellnes.no>
Tue, 3 Mar 2015 20:01:26 +0000 (21:01 +0100)
committerChristian Tellnes <christian@tellnes.no>
Thu, 5 Mar 2015 21:17:35 +0000 (22:17 +0100)
commit4874182065655dcf8a39bfa3e4c9b47bfb9e0f75
tree396700ee8f35062a9d3a256ddb9a12aca015e0d3
parent1640dedb3b2a8d6e54ba7b22290d86d5984768be
http: send Content-Length when possible

This changes the behavior for http to send send a Content-Length header
instead of using chunked encoding when we know the size of the body when
sending the headers.

Fixes: https://github.com/iojs/io.js/issues/1044
PR-URL: https://github.com/iojs/io.js/pull/1062
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Brian White <mscdex@mscdex.net>
lib/_http_outgoing.js
test/parallel/test-http-automatic-headers.js
test/parallel/test-http-client-default-headers-exist.js
test/parallel/test-http-content-length.js [new file with mode: 0644]
test/parallel/test-http-raw-headers.js
test/parallel/test-http-remove-header-stays-removed.js