diff options
| author | Dave Grijalva <dgrijalva@ngmoco.com> | 2011-09-19 11:41:09 -0700 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2011-09-19 11:41:09 -0700 |
| commit | 80700eb817a099c74fd71a9a19c3e2a7445c19df (patch) | |
| tree | 617f85b16ea7f07f1c2ab851869ba3728a8432ff /src/pkg/http/requestwrite_test.go | |
| parent | ab596cae9eac88db46326a7b01c99975da8729b6 (diff) | |
| download | go-80700eb817a099c74fd71a9a19c3e2a7445c19df.tar.xz | |
http: always include Content-Length header, even for 0
fixes #2221
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4952052
Diffstat (limited to 'src/pkg/http/requestwrite_test.go')
| -rw-r--r-- | src/pkg/http/requestwrite_test.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pkg/http/requestwrite_test.go b/src/pkg/http/requestwrite_test.go index a8cb75a597..8c29c44f49 100644 --- a/src/pkg/http/requestwrite_test.go +++ b/src/pkg/http/requestwrite_test.go @@ -246,14 +246,19 @@ var reqWriteTests = []reqWriteTest{ Body: func() io.ReadCloser { return ioutil.NopCloser(io.LimitReader(strings.NewReader("xx"), 0)) }, + // RFC 2616 Section 14.13 says Content-Length should be specified + // unless body is prohibited by the request method. + // Also, nginx expects it for POST and PUT. WantWrite: "POST / HTTP/1.1\r\n" + "Host: example.com\r\n" + "User-Agent: Go http package\r\n" + + "Content-Length: 0\r\n" + "\r\n", WantProxy: "POST / HTTP/1.1\r\n" + "Host: example.com\r\n" + "User-Agent: Go http package\r\n" + + "Content-Length: 0\r\n" + "\r\n", }, |
