Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

drive: check errors in Open() better

Nick Craig-Wood66cf2df7801e
diff --git a/drive/drive.go b/drive/drive.go
index 3caed3b31..071e429f7 100644
--- a/drive/drive.go
+++ b/drive/drive.go
@@ -929,7 +929,10 @@ func (o *FsObjectDrive) Storable() bool {
// Open an object for read
func (o *FsObjectDrive) Open() (in io.ReadCloser, err error) {
- req, _ := http.NewRequest("GET", o.url, nil)
+ req, err := http.NewRequest("GET", o.url, nil)
+ if err != nil {
+ return nil, err
+ }
req.Header.Set("User-Agent", fs.UserAgent)
res, err := o.drive.client.Do(req)
if err != nil {