summaryrefslogtreecommitdiffstats
path: root/model/client.go
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-05-06 14:32:08 -0400
committerCorey Hulen <corey@hulen.com>2016-05-06 11:32:08 -0700
commite1cae3b15b1a85fcb2ef30fee0076ae3a8d23856 (patch)
treec84ff25c95f4a80bf081e60b746178c9a12b4090 /model/client.go
parent6c75662b824491a20a757a5eec59556a866374b5 (diff)
downloadchat-e1cae3b15b1a85fcb2ef30fee0076ae3a8d23856.tar.gz
chat-e1cae3b15b1a85fcb2ef30fee0076ae3a8d23856.tar.bz2
chat-e1cae3b15b1a85fcb2ef30fee0076ae3a8d23856.zip
PLT-2600/PLT-2770 Changed getPublicLink api call to return a proper JSON string (#2914)
* Removed unused channelId and userId parameters from web client getPublicLink method * Changed getPublicLink api call to return a proper JSON string
Diffstat (limited to 'model/client.go')
-rw-r--r--model/client.go9
1 files changed, 1 insertions, 8 deletions
diff --git a/model/client.go b/model/client.go
index a74adcd7a..f045401eb 100644
--- a/model/client.go
+++ b/model/client.go
@@ -997,15 +997,8 @@ func (c *Client) GetPublicLink(filename string) (*Result, *AppError) {
if r, err := c.DoApiPost(c.GetTeamRoute()+"/files/get_public_link", MapToJson(map[string]string{"filename": filename})); err != nil {
return nil, err
} else {
- var link string
- if body, err := ioutil.ReadAll(r.Body); err == nil {
- link = string(body)
- } else {
- // all the other Client methods return an empty string on invalid json, so we can too
- }
-
return &Result{r.Header.Get(HEADER_REQUEST_ID),
- r.Header.Get(HEADER_ETAG_SERVER), link}, nil
+ r.Header.Get(HEADER_ETAG_SERVER), StringFromJson(r.Body)}, nil
}
}