From dda5a82dab7430aa1e62b27bc312a47d54414266 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 5 Jan 2011 08:08:45 -0800 Subject: [PATCH] Work around Go bug http://code.google.com/p/go/issues/detail?id=1388 --- lib/go/http/response.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/go/http/response.go b/lib/go/http/response.go index 6a209c9f8..1c799f451 100644 --- a/lib/go/http/response.go +++ b/lib/go/http/response.go @@ -86,9 +86,12 @@ func ReadResponse(r *bufio.Reader, requestMethod string) (resp *Response, err os return nil, err } f := strings.Split(line, " ", 3) - if len(f) < 3 { + if len(f) < 2 { return nil, &badStringError{"malformed HTTP response", line} } + if len(f) == 2 { + f = append(f, f[1]) // Empty Reason-Phrase + } resp.Status = f[1] + " " + f[2] resp.StatusCode, err = strconv.Atoi(f[1]) if err != nil {