joyent/node — pull request #5493 by rustyconover (2013-05-16 16:05:15+00:00)
Title:  Fix for parse error of HTTP response that has additional chunks after zero length chunk

Fix for parse error of HTTP response that has additional chunks after zero length chunk. Previously there would be no error thrown, if it was just an additional HTTP reply directly after, but if there is a chunk length rather then a 'H' character a parse error would be raised.

This patch just discards the rest of the data after the terminating zero length chunk and possibly trailing headers.

This bug was noticed when crawling amazon.com as part of bug. https://github.com/joyent/node/issues/5479