From 6da79dc3149e6552f5ec6ed71e8c206733de10b6 Mon Sep 17 00:00:00 2001 From: James Date: Wed, 26 Dec 2018 08:31:46 +1000 Subject: [PATCH] Update DownloadFile method to use generic http.Get() We do this to avoid the customised http client setting incorrect headers (which are only needed for Arlo webiste) when fetching the files from Amazon S3 --- util.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util.go b/util.go index d5b167f..ab34034 100644 --- a/util.go +++ b/util.go @@ -103,10 +103,12 @@ func (a *Arlo) DownloadFile(url, to string) error { func (a *Arlo) DownloadFile(url string, w io.Writer) error { msg := fmt.Sprintf("failed to download file (%s)", url) - resp, err := a.get(url, "", nil) + + resp, err := http.Get(url) if err != nil { return errors.WithMessage(err, msg) } + defer resp.Body.Close() _, err = io.Copy(w, resp.Body)