Merge branch '21705-go-deps'
[arvados.git] / sdk / go / arvados / client.go
index 09185d1d6be2f7c8dc1136603b9ce11dc0f304e2..ead66c3d408a2212cbfb6693bf4e03711f913a4d 100644 (file)
@@ -252,8 +252,6 @@ var reqIDGen = httpserver.IDGenerator{Prefix: "req-"}
 
 var nopCancelFunc context.CancelFunc = func() {}
 
-var reqErrorRe = regexp.MustCompile(`net/http: invalid header `)
-
 // Do augments (*http.Client)Do(): adds Authorization and X-Request-Id
 // headers, delays in order to comply with rate-limiting restrictions,
 // and retries failed requests when appropriate.
@@ -311,14 +309,6 @@ func (c *Client) Do(req *http.Request) (*http.Response, error) {
                if c.Timeout == 0 {
                        return false, nil
                }
-               // This check can be removed when
-               // https://github.com/hashicorp/go-retryablehttp/pull/210
-               // (or equivalent) is merged and we update go.mod.
-               // Until then, it is needed to pass
-               // TestNonRetryableStdlibError.
-               if respErr != nil && reqErrorRe.MatchString(respErr.Error()) {
-                       return false, nil
-               }
                retrying, err := retryablehttp.DefaultRetryPolicy(ctx, resp, respErr)
                if retrying {
                        lastResp, lastRespBody, lastErr = resp, nil, respErr