Fix health check (#2412)

Fix https://github.com/woodpecker-ci/woodpecker/issues/2370
This commit is contained in:
qwerty287 2023-09-09 14:45:24 +02:00 committed by GitHub
parent 6d59bd1130
commit a06a626666
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -56,8 +56,8 @@ func pinger(c *cli.Context) error {
return err return err
} }
defer resp.Body.Close() defer resp.Body.Close()
if resp.StatusCode != http.StatusOK { if resp.StatusCode < 200 && resp.StatusCode >= 300 {
return fmt.Errorf("server returned non-200 status code") return fmt.Errorf("server returned bad status code")
} }
return nil return nil
} }