From 1578ebb0e2d8cc90b84a42b90205c5f1a9b69b08 Mon Sep 17 00:00:00 2001 From: Wim Date: Sat, 24 Feb 2018 23:35:53 +0100 Subject: Refactor slack --- bridge/helper/helper.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'bridge/helper') diff --git a/bridge/helper/helper.go b/bridge/helper/helper.go index 907642c1..81789741 100644 --- a/bridge/helper/helper.go +++ b/bridge/helper/helper.go @@ -11,11 +11,18 @@ import ( ) func DownloadFile(url string) (*[]byte, error) { + return DownloadFileAuth(url, "") +} + +func DownloadFileAuth(url string, auth string) (*[]byte, error) { var buf bytes.Buffer client := &http.Client{ Timeout: time.Second * 5, } req, err := http.NewRequest("GET", url, nil) + if auth != "" { + req.Header.Add("Authorization", auth) + } if err != nil { return nil, err } -- cgit v1.2.3