drive: Add "Forbidden to download" message for files with no downloadURL - fixes #95

This commit is contained in:
Nick Craig-Wood 2015-08-16 14:11:21 +01:00
parent e2f4d7b5e3
commit 88ea8b305d
1 changed files with 3 additions and 0 deletions

View File

@ -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