From fe9596bfbb029c1b917dd7c7f41469bf2e1dbca9 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sun, 24 Apr 2016 11:06:30 +0100 Subject: [PATCH] Remove extra / in Metadata request This fixes the issuing of a request with a doubled slash in the URL. This causes Dropbox to issue a 301 redirect to the URL without the `//` which causes an extra HTTP transaction. --- dropbox.go | 1 + 1 file changed, 1 insertion(+) diff --git a/dropbox.go b/dropbox.go index 7adc943..319b957 100644 --- a/dropbox.go +++ b/dropbox.go @@ -832,6 +832,7 @@ func (db *Dropbox) Metadata(src string, list bool, includeDeleted bool, hash, re params.Set("hash", hash) } + src = strings.Trim(src, "/") act := strings.Join([]string{"metadata", db.RootDirectory, src}, "/") err := db.doRequest("GET", act, params, &rv) return &rv, err