4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-06-26 16:39:24 +00:00

Refactor slack

This commit is contained in:
Wim
2018-02-24 23:35:53 +01:00
parent 73525a4bbc
commit 1578ebb0e2
2 changed files with 316 additions and 250 deletions

View File

@ -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
}