mirror of
https://github.com/SSLMate/certspotter.git
synced 2025-06-27 10:15:33 +02:00
Properly handle non-200 responses from logs
This commit is contained in:
parent
1fc964732b
commit
196bd864cd
@ -106,6 +106,9 @@ func (c *LogClient) fetchAndParse(uri string, res interface{}) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if resp.StatusCode / 100 != 2 {
|
||||
return fmt.Errorf("GET %s: %s (%s)", uri, resp.Status, string(body))
|
||||
}
|
||||
if err = json.Unmarshal(body, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user