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:
parent
077668ca58
commit
6da79dc314
4
util.go
4
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)
|
||||
|
Loading…
Reference in New Issue
Block a user