Descriptionhttp: better handling of 0-length Request.Body
As rsc suggested after change 58a6bdac3d12 was committed, we
now read the first byte of Request.Body when the
Request.ContentLength is 0 to disambiguate between a truly
zero-length body and a body of unknown length where the user
didn't set the ContentLength field.
This was also causing the reverse proxy problem where incoming
requests (which always have a body, of private type http.body,
even for 0-lengthed requests) were being relayed to the http
Transport for fetching, which was serializing the request as a
chunked request (since ContentLength was 0 and Body was
non-nil)
Fixes issue 1999
Patch Set 1 #Patch Set 2 : diff -r 90f9c658e53d https://go.googlecode.com/hg #Patch Set 3 : diff -r 90f9c658e53d https://go.googlecode.com/hg #
Total comments: 2
Patch Set 4 : diff -r 90f9c658e53d https://go.googlecode.com/hg #
MessagesTotal messages: 4
|