alphagov/router — pull request #68 by KushalP (2014-05-16 10:48:15+00:00)
Title: If a bad HTTP Content-Length header is provided; return a 500 response

This was a regression found when compiling and testing the router under go 1.2 compared to 1.1.2 (currently built against version). Since go 1.2 the behaviour for how bad Content-Length headers are handled has changed from providing a (private) error value that we could match against through to directly returning an io.ErrUnexpectedEOF error.

The issue that we raised with the Go project can be found here: https://code.google.com/p/go/issues/detail?id=8003

In a discussion between @alext, @dcarley and myself we agreed (and checked) that this behaviour wouldn't make it harder to track logs through our environments.

Question for the reviewer of this PR: I've kept the code that matched against `http: Request.ContentLength=\d+ with Body length \d+` in place but there's no longer a test for it as we can't hit it using the `RountTripper`. Should this also be removed?