Skip to content

Commit e3dfa3c

Browse files
committed
Retry when getting an error on HEAD/GET requests
1 parent 4ea0c92 commit e3dfa3c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

swift.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,10 @@ func (c *Connection) Call(targetUrl string, p RequestOpts) (resp *http.Response,
465465
req.Header.Add("X-Auth-Token", authToken)
466466
resp, err = c.doTimeoutRequest(timer, req)
467467
if err != nil {
468+
if p.Operation == "HEAD" || p.Operation == "GET" {
469+
retries--;
470+
continue
471+
}
468472
return
469473
}
470474
// Check to see if token has expired

0 commit comments

Comments
 (0)