diff options
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 } |