checker: don't validate http challenge if error status returns
This commit is contained in:
parent
9cd237daff
commit
efab34d551
|
@ -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
|
||||
}
|
||||
|
|
Reference in New Issue