From a76221e3fca94f339a7bb17aca1755d857a08842 Mon Sep 17 00:00:00 2001 From: Donomii Date: Sat, 15 Jul 2017 18:12:06 +0200 Subject: [PATCH] Remove print statement --- client.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client.go b/client.go index f4cc102..8be359a 100644 --- a/client.go +++ b/client.go @@ -591,10 +591,10 @@ func (cli *Client) UploadLink(link string) (*RespMediaUpload, error) { return cli.UploadToContentRepo(res.Body, res.Header.Get("Content-Type"), res.ContentLength) } -// Download download a mxc url +// Download download a mxc url. Used to get sent file/photos/etc from the matrix server func (cli *Client) Download(url string) (string, []byte, error) { path := strings.Replace(url, "mxc://", "", 1) - req, err := http.NewRequest("GET", cli.BuildBaseURL("_matrix/media/r0/download/"+path), nil) + req, _ := http.NewRequest("GET", cli.BuildBaseURL("_matrix/media/r0/download/"+path), nil) res, err := cli.Client.Do(req) if err != nil { @@ -604,7 +604,6 @@ func (cli *Client) Download(url string) (string, []byte, error) { defer res.Body.Close() contents, err := ioutil.ReadAll(res.Body) - fmt.Println(res.Header) filename := res.Header["Content-Disposition"][0] if err != nil { fmt.Println("Error while downloading", url, "-", err)