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 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
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
Reference in New Issue
Block a user