Fix sharing file without short URL (Fix #16)
This commit is contained in:
parent
4423ac7952
commit
b9979d969d
|
@ -645,9 +645,7 @@ func (db *Dropbox) Shares(path string, shortURL bool) (*Link, error) {
|
||||||
var rv Link
|
var rv Link
|
||||||
var params *url.Values
|
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}, "/")
|
act := strings.Join([]string{"shares", db.RootDirectory, path}, "/")
|
||||||
err := db.doRequest("POST", act, params, &rv)
|
err := db.doRequest("POST", act, params, &rv)
|
||||||
return &rv, err
|
return &rv, err
|
||||||
|
|
|
@ -695,10 +695,13 @@ func TestShares(t *testing.T) {
|
||||||
t.Fatalf("could not run test due to marshalling issue")
|
t.Fatalf("could not run test due to marshalling issue")
|
||||||
}
|
}
|
||||||
fake := FakeHTTP{
|
fake := FakeHTTP{
|
||||||
Method: "POST",
|
Method: "POST",
|
||||||
Host: "api.dropbox.com",
|
Host: "api.dropbox.com",
|
||||||
Path: "/1/shares/auto/" + filename,
|
Path: "/1/shares/auto/" + filename,
|
||||||
Params: map[string]string{"locale": "en"},
|
Params: map[string]string{
|
||||||
|
"locale": "en",
|
||||||
|
"short_url": "false",
|
||||||
|
},
|
||||||
t: t,
|
t: t,
|
||||||
ResponseData: js,
|
ResponseData: js,
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue
Block a user