Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pkg/engine/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,14 @@ func downloadUpdateConfigFile(urlStr string, existsAlready, initial bool, pat, u
return false, err
}
defer resp.Body.Close()

if resp.StatusCode != http.StatusOK {
return false, fmt.Errorf("received non-200 HTTP status from %s: %d %s", urlStr, resp.StatusCode, resp.Status)
}

newBytes, err := io.ReadAll(resp.Body)
if err != nil {
return false, fmt.Errorf("error downloading config from %s: %v", err)
return false, fmt.Errorf("error downloading config from %s: %v", urlStr, err)
}
if newBytes == nil {
// if initial, this is the last resort, newBytes should be populated
Expand Down