Properly check for status 200

This commit is contained in:
Thomas Boerger
2018-05-02 11:53:44 +02:00
parent b6fa684ea3
commit e12b6abe00
+4
View File
@@ -81,6 +81,10 @@ func (p Plugin) Exec() error {
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return errors.Errorf("request failed, status %s", http.StatusText(resp.StatusCode))
}
target, err := os.Create(destination)
if err != nil {