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
}
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
}