From d93ac320ecff3dd0d86e4c4cd43c0b640124c3d2 Mon Sep 17 00:00:00 2001 From: gutmet Date: Sat, 8 Aug 2020 12:00:45 +0200 Subject: [PATCH] fix status check --- drivel.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivel.go b/drivel.go index d07bf73..7b3c84a 100644 --- a/drivel.go +++ b/drivel.go @@ -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)))