From a06a6266666a9cad09d2c99cd188cef7906d9241 Mon Sep 17 00:00:00 2001 From: qwerty287 <80460567+qwerty287@users.noreply.github.com> Date: Sat, 9 Sep 2023 14:45:24 +0200 Subject: [PATCH] Fix health check (#2412) Fix https://github.com/woodpecker-ci/woodpecker/issues/2370 --- cmd/server/health.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/server/health.go b/cmd/server/health.go index 73ce374792..eb780b9a92 100644 --- a/cmd/server/health.go +++ b/cmd/server/health.go @@ -56,8 +56,8 @@ func pinger(c *cli.Context) error { return err } defer resp.Body.Close() - if resp.StatusCode != http.StatusOK { - return fmt.Errorf("server returned non-200 status code") + if resp.StatusCode < 200 && resp.StatusCode >= 300 { + return fmt.Errorf("server returned bad status code") } return nil }