Skip to content

Commit

Permalink
fix(seafile): driver panic while downloading or uploading file (#4491)
Browse files Browse the repository at this point in the history
Co-authored-by: Andy Hsu <i@nn.ci>
  • Loading branch information
kaaass and xhofe authored May 28, 2023
1 parent a80e219 commit 8421c72
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions drivers/seafile/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,14 @@ func (d *Seafile) request(method string, pathname string, callback base.ReqCallb
if len(noRedirect) > 0 && noRedirect[0] {
req = base.NoRedirectClient.R()
}
var res resty.Response
req.SetHeader("Authorization", d.authorization)
callback(req)
var (
res *resty.Response
err error
)
for i := 0; i < 2; i++ {
req.SetHeader("Authorization", d.authorization)
callback(req)
res, err := req.Execute(method, full)
res, err = req.Execute(method, full)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 8421c72

Please sign in to comment.