fix(seafile): driver panic while downloading or uploading file (#4491)
Co-authored-by: Andy Hsu <i@nn.ci>
This commit is contained in:
parent
a80e21997c
commit
8421c72c5c
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user