• Brad Fitzpatrick's avatar
    http: better handling of 0-length Request.Body · 5d4eea6a
    Brad Fitzpatrick authored
    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 #1999
    
    R=golang-dev, kevlar
    CC=golang-dev
    https://golang.org/cl/4628063
    5d4eea6a
Name
Last commit
Last update
..
cgi Loading commit data...
fcgi Loading commit data...
httptest Loading commit data...
pprof Loading commit data...
spdy Loading commit data...
testdata Loading commit data...
Makefile Loading commit data...
chunked.go Loading commit data...
client.go Loading commit data...
client_test.go Loading commit data...
cookie.go Loading commit data...
cookie_test.go Loading commit data...
dump.go Loading commit data...
export_test.go Loading commit data...
fs.go Loading commit data...
fs_test.go Loading commit data...
header.go Loading commit data...
header_test.go Loading commit data...
lex.go Loading commit data...
lex_test.go Loading commit data...
persist.go Loading commit data...
proxy_test.go Loading commit data...
range_test.go Loading commit data...
readrequest_test.go Loading commit data...
request.go Loading commit data...
request_test.go Loading commit data...
requestwrite_test.go Loading commit data...
response.go Loading commit data...
response_test.go Loading commit data...
responsewrite_test.go Loading commit data...
reverseproxy.go Loading commit data...
reverseproxy_test.go Loading commit data...
serve_test.go Loading commit data...
server.go Loading commit data...
status.go Loading commit data...
transfer.go Loading commit data...
transport.go Loading commit data...
transport_test.go Loading commit data...
triv.go Loading commit data...
url.go Loading commit data...
url_test.go Loading commit data...