putio: make downloading files use the rclone http Client

This fixes `--download-header` and these transactions being missed from
`--dump bodies` or `--tpslimit`
This commit is contained in:
Nick Craig-Wood 2020-04-23 15:48:30 +01:00
parent f6346a4d29
commit 7c98ecd3ab
2 changed files with 7 additions and 3 deletions

View file

@ -241,7 +241,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read
req.Header.Set(header, value)
}
// fs.Debugf(o, "opening file: id=%d", o.file.ID)
resp, err = http.DefaultClient.Do(req)
resp, err = o.fs.httpClient.Do(req)
return shouldRetry(err)
})
if perr, ok := err.(*putio.ErrorResponse); ok && perr.Response.StatusCode >= 400 && perr.Response.StatusCode <= 499 {