diff --git a/pkg/http/ip.go b/pkg/http/ip.go index d952c05..f65e3ef 100644 --- a/pkg/http/ip.go +++ b/pkg/http/ip.go @@ -204,6 +204,11 @@ func (r *IPRepository) testDomainLatency(client *HTTPClient, domain string) (flo retErr = err break } + if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusPartialContent { + r.log.Warnf("Failed to download from %s: %s", domain, resp.Status) + retErr = fmt.Errorf("status code: %s", resp.Status) + break + } limitedReader := io.LimitReader(resp.Body, testFileSize)