bvanderveen/httpmachine — pull request #7 by mcunha (2012-03-29 07:38:07+00:00)
Title: Fix http 1.0

Once more, now with feeling! It was nagging me why HTTP 1.0 GET's were not failing in unit testing, and yet they failed with curl in a sample app.

Commits include:
* Fix test harness to *not* provide EOF marker - real world clients will not disconnect/provide EOF until they have a response, so the parser needs to pass acceptable requests along, and only read to EOF if reasonably sure there's an entity body being sent. This change breaks a bunch of tests if not applied with the parser fixes below.
* Fix HTTP 1.0 POST to include Content-Length as per RFC
* Add HTTP 1.0 POST without Content-Length - this should not happen and if it does we should parse headers and then pass request along the stack so they can send HTTP 400/411 back. This test fails without parser fixes below.
* Fix parser to only read to EOF when an entity body is known to be present - Requests that fail to signal entity body presence should be replied to with error messages but should not hang parser until client drops connection.
* Minor update to gitignore to forget about test-results folders used by MonoDevelop [in current MD alpha at least]

Well known use cases triggering HTTP 1.0 usage include using nginx as a reverse proxy, possibly others.