diff options
| author | Ondřej Surý <ondrej@sury.org> | 2011-06-03 11:31:24 +0200 |
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2011-06-03 11:38:02 +0200 |
| commit | 13f4fcd5bf09c70942b6c85a2b919ffa1ca0c6a8 (patch) | |
| tree | 717e1ceeef3a60af29e7897c7629d1502b797838 /src/pkg/http/requestwrite_test.go | |
| parent | 6bf52070ef1028f7fcc98fad1e73795a7efd7ce7 (diff) | |
| download | golang-13f4fcd5bf09c70942b6c85a2b919ffa1ca0c6a8.tar.gz | |
Imported Upstream version 2011.06.02
Diffstat (limited to 'src/pkg/http/requestwrite_test.go')
| -rw-r--r-- | src/pkg/http/requestwrite_test.go | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/pkg/http/requestwrite_test.go b/src/pkg/http/requestwrite_test.go index beb51fb8d..2889048a9 100644 --- a/src/pkg/http/requestwrite_test.go +++ b/src/pkg/http/requestwrite_test.go @@ -175,6 +175,35 @@ var reqWriteTests = []reqWriteTest{ "abcdef", }, + // HTTP/1.1 POST with Content-Length in headers + { + Request{ + Method: "POST", + RawURL: "http://example.com/", + Host: "example.com", + Header: Header{ + "Content-Length": []string{"10"}, // ignored + }, + ContentLength: 6, + }, + + []byte("abcdef"), + + "POST http://example.com/ HTTP/1.1\r\n" + + "Host: example.com\r\n" + + "User-Agent: Go http package\r\n" + + "Content-Length: 6\r\n" + + "\r\n" + + "abcdef", + + "POST http://example.com/ HTTP/1.1\r\n" + + "Host: example.com\r\n" + + "User-Agent: Go http package\r\n" + + "Content-Length: 6\r\n" + + "\r\n" + + "abcdef", + }, + // default to HTTP/1.1 { Request{ |
