summaryrefslogtreecommitdiff
path: root/libgo/go/net/http/response_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/net/http/response_test.go')
-rw-r--r--libgo/go/net/http/response_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/libgo/go/net/http/response_test.go b/libgo/go/net/http/response_test.go
index f73172189e9..d6e77b19c10 100644
--- a/libgo/go/net/http/response_test.go
+++ b/libgo/go/net/http/response_test.go
@@ -618,6 +618,15 @@ func TestResponseContentLengthShortBody(t *testing.T) {
}
}
+func TestReadResponseUnexpectedEOF(t *testing.T) {
+ br := bufio.NewReader(strings.NewReader("HTTP/1.1 301 Moved Permanently\r\n" +
+ "Location: http://example.com"))
+ _, err := ReadResponse(br, nil)
+ if err != io.ErrUnexpectedEOF {
+ t.Errorf("ReadResponse = %v; want io.ErrUnexpectedEOF", err)
+ }
+}
+
func TestNeedsSniff(t *testing.T) {
// needsSniff returns true with an empty response.
r := &response{}