mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-06-26 16:39:24 +00:00
Refactor slack
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user