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
This commit is contained in:
James 2018-12-26 08:31:46 +10:00
parent 077668ca58
commit 6da79dc314

View File

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