From 88ea8b305d1e46fdff7e2b9a127ad7515e3e86c0 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sun, 16 Aug 2015 14:11:21 +0100 Subject: [PATCH] drive: Add "Forbidden to download" message for files with no downloadURL - fixes #95 --- drive/drive.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drive/drive.go b/drive/drive.go index d73705058..7420fca37 100644 --- a/drive/drive.go +++ b/drive/drive.go @@ -962,6 +962,9 @@ func (o *FsObjectDrive) Storable() bool { // Open an object for read func (o *FsObjectDrive) Open() (in io.ReadCloser, err error) { + if o.url == "" { + return nil, fmt.Errorf("Forbidden to download - check sharing permission") + } req, err := http.NewRequest("GET", o.url, nil) if err != nil { return nil, err