fix(139,189,189pc,alidrive,onedrive,yandex):http response body is not close #1072

This commit is contained in:
foxxorcat
2022-05-10 21:35:42 +08:00
parent a9027c0f06
commit b6af9aa587
6 changed files with 11 additions and 1 deletions

View File

@ -307,8 +307,10 @@ func (driver Onedrive) UploadBig(file *model.FileStream, account *model.Account)
res, err := base.HttpClient.Do(req)
if res.StatusCode != 201 && res.StatusCode != 202 {
data, _ := ioutil.ReadAll(res.Body)
res.Body.Close()
return errors.New(string(data))
}
res.Body.Close()
}
return nil
}