diff --git a/pkg/protoretry/client.go b/pkg/protoretry/client.go index 43fbb61..353531a 100644 --- a/pkg/protoretry/client.go +++ b/pkg/protoretry/client.go @@ -2,6 +2,7 @@ package protoretry import ( "context" + "crypto/tls" "errors" "io" "net/http" @@ -20,7 +21,7 @@ func New(base *http.Client) *Client { func (c *Client) Do(req *http.Request) (*http.Response, error) { if res, err := c.base.Do(req); err == nil { return res, nil - } else if !errors.Is(err, syscall.ECONNREFUSED) { + } else if !errors.Is(err, syscall.ECONNREFUSED) && !errors.Is(err, tls.RecordHeaderError{}) { return nil, err }