Merge pull request #4 from drone-plugins/stats-code

Properly check for status 200
This commit is contained in:
Thomas Boerger
2018-05-02 13:01:37 +02:00
committed by GitHub
+4
View File
@@ -88,6 +88,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 {