Skip to content

Commit 71efe62

Browse files
committed
Silence logging on malformed responses
1 parent 656e61d commit 71efe62

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

httpu/httpu.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"bytes"
66
"errors"
77
"fmt"
8+
"io"
89
"log"
910
"net"
1011
"net/http"
@@ -122,7 +123,9 @@ func (httpu *HTTPUClient) Do(req *http.Request, timeout time.Duration, numSends
122123
// Parse response.
123124
response, err := http.ReadResponse(bufio.NewReader(bytes.NewBuffer(responseBytes[:n])), req)
124125
if err != nil {
125-
log.Printf("httpu: error while parsing response: %v", err)
126+
if err != io.ErrUnexpectedEOF {
127+
log.Printf("httpu: error while parsing response: %v", err)
128+
}
126129
continue
127130
}
128131

0 commit comments

Comments
 (0)