diff --git a/checker/checker.go b/checker/checker.go index 4cf16c7..d8b252a 100644 --- a/checker/checker.go +++ b/checker/checker.go @@ -110,6 +110,11 @@ func check_http(ip string) (err error) { return } defer resp.Body.Close() + + if resp.StatusCode >= 400 { + return fmt.Errorf("Bad status, got: %d (%s)", resp.StatusCode, resp.Status) + } + _, err = ioutil.ReadAll(resp.Body) return } @@ -123,6 +128,11 @@ func check_https(domain, ip string) (err error) { return } defer resp.Body.Close() + + if resp.StatusCode >= 300 { + return fmt.Errorf("Bad status, got: %d (%s)", resp.StatusCode, resp.Status) + } + _, err = ioutil.ReadAll(resp.Body) return }