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:
parent
b8a3ed0e44
commit
a0e4de3d19
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue