diff --git a/reqest.go b/reqest.go index 8223e5b..f6d8db3 100644 --- a/reqest.go +++ b/reqest.go @@ -147,7 +147,7 @@ func (d *RequestDecoder) Decode(data io.Writer) (*Request, error) { // when we read from a stream, we may get an EOF if we want to read the end tag // all data should be read and we can ignore the error if err == io.EOF { - break + return req, nil } return nil, err } diff --git a/response.go b/response.go index 7ff3e7b..94a2230 100644 --- a/response.go +++ b/response.go @@ -223,7 +223,7 @@ func (d *ResponseDecoder) Decode(data io.Writer) (*Response, error) { // when we read from a stream, we may get an EOF if we want to read the end tag // all data should be read and we can ignore the error if err == io.EOF { - break + return resp, nil } return nil, err }