1
0
mirror of https://github.com/golang/go synced 2024-11-21 19:14:44 -07:00
The Go programming language
Go to file
Brad Fitzpatrick 5d4eea6a2f http: 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 #1999

R=golang-dev, kevlar
CC=golang-dev
https://golang.org/cl/4628063
2011-06-24 16:46:14 -07:00
doc weekly.2011-06-23 2011-06-24 16:04:17 +10:00
include build: fix header files for Plan 9 2011-06-14 14:14:11 -04:00
lib codereview.py: note that hg change -d abandons a change list 2011-06-20 14:50:00 -04:00
misc misc/emacs: update list of builtins. 2011-06-24 11:19:48 -07:00
src http: better handling of 0-length Request.Body 2011-06-24 16:46:14 -07:00
test os.Error API: don't export os.ErrorString, use os.NewError consistently 2011-06-22 10:52:47 -07:00
.hgignore go/build: exclude cgo test from arm 2011-06-06 09:25:30 +10:00
.hgtags tag weekly.2011-06-23 2011-06-24 16:18:39 +10:00
AUTHORS A+C: Ken Rockot (individual CLA) 2011-06-22 18:07:08 -04:00
CONTRIBUTORS A+C: Ken Rockot (individual CLA) 2011-06-22 18:07:08 -04:00
favicon.ico add a favicon plus a couple of hi-res versions of gordon 2009-10-26 10:13:07 -07:00
LICENSE LICENSE: separate, change PATENTS text 2010-12-06 16:31:59 -05:00
PATENTS LICENSE: separate, change PATENTS text 2010-12-06 16:31:59 -05:00
README build: update, streamline documentation for new $GOBIN 2010-08-24 20:00:50 -04:00
robots.txt godoc: serve robots.txt raw 2011-02-19 05:46:20 +11:00

This is the source code repository for the Go programming language.  

For documentation about how to install and use Go,
visit http://golang.org/ or load doc/install.html in your web browser.

After installing Go, you can view a nicely formatted
doc/install.html by running godoc --http=:6060
and then visiting http://localhost:6060/doc/install.html.

Unless otherwise noted, the Go source files are distributed
under the BSD-style license found in the LICENSE file.

--

Binary Distribution Notes

If you have just untarred a binary Go distribution, you need to set
the environment variable $GOROOT to the full path of the go
directory (the one containing this README).  You can omit the
variable if you unpack it into /usr/local/go, or if you rebuild
from sources by running all.bash (see doc/install.html).
You should also add the Go binary directory $GOROOT/bin
to your shell's path.

For example, if you extracted the tar file into $HOME/go, you might
put the following in your .profile:

    export GOROOT=$HOME/go
    export PATH=$PATH:$GOROOT/bin

See doc/install.html for more details.