diff options
author | Wim <wim@42.be> | 2018-02-24 23:35:53 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2018-02-27 23:22:10 +0100 |
commit | 1578ebb0e2d8cc90b84a42b90205c5f1a9b69b08 (patch) | |
tree | 5e3f226bffd4829c0aa9fe2c04a7af31d9ba35fb /bridge/helper/helper.go | |
parent | 73525a4bbcb3cc9de33ab6d4e16ddfd038e7c7c8 (diff) | |
download | matterbridge-msglm-1578ebb0e2d8cc90b84a42b90205c5f1a9b69b08.tar.gz matterbridge-msglm-1578ebb0e2d8cc90b84a42b90205c5f1a9b69b08.tar.bz2 matterbridge-msglm-1578ebb0e2d8cc90b84a42b90205c5f1a9b69b08.zip |
Refactor slack
Diffstat (limited to 'bridge/helper/helper.go')
-rw-r--r-- | bridge/helper/helper.go | 7 |
1 files changed, 7 insertions, 0 deletions
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 } |