diff options
Diffstat (limited to 'libgo/go/net/http/request.go')
-rw-r--r-- | libgo/go/net/http/request.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libgo/go/net/http/request.go b/libgo/go/net/http/request.go index 5277657805d..f5bc6eb9100 100644 --- a/libgo/go/net/http/request.go +++ b/libgo/go/net/http/request.go @@ -455,11 +455,13 @@ func ReadRequest(b *bufio.Reader) (req *Request, err error) { // First line: GET /index.html HTTP/1.0 var s string if s, err = tp.ReadLine(); err != nil { + return nil, err + } + defer func() { if err == io.EOF { err = io.ErrUnexpectedEOF } - return nil, err - } + }() var f []string if f = strings.SplitN(s, " ", 3); len(f) < 3 { |