Skip to content

Commit

Permalink
check the status code
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo82148 committed Aug 30, 2023
1 parent 321d70b commit 20b6c55
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/cmd/update_certificate/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ func download(ctx context.Context, url string) ([]byte, error) {
}
defer resp.Body.Close()

if resp.StatusCode != http.StatusOK {
return nil, fmt.Errorf("unexpected status code: %d", resp.StatusCode)
}

return io.ReadAll(resp.Body)
}

Expand Down

0 comments on commit 20b6c55

Please sign in to comment.