aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/readrequest_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/http/readrequest_test.go')
-rw-r--r--src/net/http/readrequest_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/net/http/readrequest_test.go b/src/net/http/readrequest_test.go
index 5aaf3b9fe2..2da3122879 100644
--- a/src/net/http/readrequest_test.go
+++ b/src/net/http/readrequest_test.go
@@ -207,6 +207,22 @@ var reqTests = []reqTest{
noError,
},
+ // Tests chunked body and an invalid Content-Length.
+ {
+ "POST / HTTP/1.1\r\n" +
+ "Host: foo.com\r\n" +
+ "Transfer-Encoding: chunked\r\n" +
+ "Content-Length: notdigits\r\n\r\n" + // raise an error
+ "3\r\nfoo\r\n" +
+ "3\r\nbar\r\n" +
+ "0\r\n" +
+ "\r\n",
+ nil,
+ noBodyStr,
+ noTrailer,
+ `bad Content-Length "notdigits"`,
+ },
+
// CONNECT request with domain name:
{
"CONNECT www.google.com:443 HTTP/1.1\r\n\r\n",