fix status check
This commit is contained in:
parent
56db7d59dd
commit
d93ac320ec
|
@ -131,7 +131,7 @@ func send(client *http.Client, url string, vals url.Values) []byte {
|
|||
log(err)
|
||||
defer resp.Body.Close()
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
if resp.StatusCode < 200 || resp.StatusCode > 299 {
|
||||
fmt.Fprintln(os.Stderr, "response:", resp, "\n")
|
||||
fmt.Fprintln(os.Stderr, "body:", string(body), "\n")
|
||||
log(errors.New("HTTP status " + fmt.Sprint(resp.StatusCode)))
|
||||
|
|
Loading…
Reference in New Issue
Block a user