no guardar archivo si no es 200 OK

This commit is contained in:
Cat /dev/Nulo 2023-01-21 00:38:37 -03:00
parent acdf974adc
commit cb930496c9

View file

@ -51,6 +51,9 @@ func (d *Downloader) download(url string, output string, doneChan chan error) {
doneChan <- err doneChan <- err
return return
} }
if res.StatusCode != http.StatusOK {
return
}
f, err := os.Create(output) f, err := os.Create(output)
if err != nil { if err != nil {
doneChan <- err doneChan <- err