1
0
Fork 0
mirror of https://gitlab.com/pnx-tools/dns-updater.git synced 2026-06-16 05:54:56 +02:00

http/get.go: only status code 400 or greater should be considered an error.

This commit is contained in:
Henrik Hautakoski 2024-01-14 12:18:25 +01:00
parent b8a3ed0e44
commit a0e4de3d19

View file

@ -20,7 +20,7 @@ func Get(ctx context.Context, url string, headers http.Header) (*http.Response,
return nil, err
}
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
if resp.StatusCode >= 400 {
return nil, fmt.Errorf("HTTP Response: %s", resp.Status)
}
return resp, nil