stacktic
/
dropbox
Archived
1
0
Fork 0

Fix sharing file without short URL (Fix #16)

This commit is contained in:
Arnaud Ysmal 2015-02-26 19:27:41 +01:00
parent 4423ac7952
commit b9979d969d
2 changed files with 8 additions and 7 deletions

View File

@ -645,9 +645,7 @@ func (db *Dropbox) Shares(path string, shortURL bool) (*Link, error) {
var rv Link
var params *url.Values
if shortURL {
params = &url.Values{"short_url": {strconv.FormatBool(shortURL)}}
}
params = &url.Values{"short_url": {strconv.FormatBool(shortURL)}}
act := strings.Join([]string{"shares", db.RootDirectory, path}, "/")
err := db.doRequest("POST", act, params, &rv)
return &rv, err

View File

@ -695,10 +695,13 @@ func TestShares(t *testing.T) {
t.Fatalf("could not run test due to marshalling issue")
}
fake := FakeHTTP{
Method: "POST",
Host: "api.dropbox.com",
Path: "/1/shares/auto/" + filename,
Params: map[string]string{"locale": "en"},
Method: "POST",
Host: "api.dropbox.com",
Path: "/1/shares/auto/" + filename,
Params: map[string]string{
"locale": "en",
"short_url": "false",
},
t: t,
ResponseData: js,
}