Between Go 1.1.2 and Go 1.2 the net/http
package changed behaviour in how it handled bad Content-Length
values in requests.
Link to issue: https://code.google.com/p/go/issues/detail?id=8003
Tested using go version go1.2.1 linux/amd64
and go version go1.1.2 linux/amd64
. Also tested using go version devel +f8b50ad4cac4 Mon Apr 21 17:00:27 2014 -0700 + darwin/amd64
.
In separate shells run go run backend.go
and go run server.go
.
$ ruby test_client.rb
HTTP/1.1 400 Bad Request
Content-Type: text/plain; charset=utf-8
Date: Thu, 15 May 2014 12:49:39 GMT
Transfer-Encoding: chunked
0
$ ruby test_client.rb
HTTP/1.1 500 Internal Server Error
Date: Thu, 15 May 2014 12:47:14 GMT
Content-Length: 0
Content-Type: text/plain; charset=utf-8