fix(ipinfo): handle 403 as too many requests
This commit is contained in:
@@ -51,7 +51,7 @@ func (f *Fetch) FetchInfo(ctx context.Context, ip net.IP) (
|
|||||||
|
|
||||||
switch response.StatusCode {
|
switch response.StatusCode {
|
||||||
case http.StatusOK:
|
case http.StatusOK:
|
||||||
case http.StatusTooManyRequests:
|
case http.StatusTooManyRequests, http.StatusForbidden:
|
||||||
return result, fmt.Errorf("%w from %s: %d %s",
|
return result, fmt.Errorf("%w from %s: %d %s",
|
||||||
ErrTooManyRequests, url, response.StatusCode, response.Status)
|
ErrTooManyRequests, url, response.StatusCode, response.Status)
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user