func newClient(gc GlobalConfig) *http.Client {
	client := &http.Client{
		Transport: &http.Transport{ // ignore insecure certificates
			TLSClientConfig:     &tls.Config{InsecureSkipVerify: !gc.GetScraperCertCheck()},
			MaxIdleConnsPerHost: maxIdleConnsPerHost,
		},
		Timeout: scrapeGetTimeout,
		// defaultCheckRedirect code with max changed from 10 to maxRedirects
		CheckRedirect: func(req *http.Request, via []*http.Request) error {
			if len(via) >= maxRedirects {
				return fmt.Errorf("%w: gave up after %d redirects", ErrMaxRedirects, maxRedirects)
			}
			return nil
		},
	}

	return client
}
// newClient creates a scraper-local http client we use throughout the scraper subsystem.
newClient creates a scraper-local http client we use throughout the scraper subsystem.
// newClient creates a scraper - local http client we use throughout the scraper subsystem .
func newClient(gc GlobalConfig) *http.Client {
	client := &http.Client{
		Transport: &http.Transport{ 
			TLSClientConfig:     &tls.Config{InsecureSkipVerify: !gc.GetScraperCertCheck()},
			MaxIdleConnsPerHost: maxIdleConnsPerHost,
		},
		Timeout: scrapeGetTimeout,
		CheckRedirect: func(req *http.Request, via []*http.Request) error {
			if len(via) >= maxRedirects {
				return fmt.Errorf("%w: gave up after %d redirects", ErrMaxRedirects, maxRedirects)
			}
			return nil
		},
	}
	return client
}
func newClient ( gc GlobalConfig ) * http . Client { client := & http . Client { Transport : & http . Transport { TLSClientConfig : & tls . Config { InsecureSkipVerify : ! gc . GetScraperCertCheck ( ) } , MaxIdleConnsPerHost : maxIdleConnsPerHost , } , Timeout : scrapeGetTimeout , CheckRedirect : func ( req * http . Request , via [ ] * http . Request ) error { if len ( via ) >= maxRedirects { return fmt . Errorf ( " " , ErrMaxRedirects , maxRedirects ) } return nil } , } return client }
newClient creates a scraper-local http client we use throughout the scraper subsystem.
newClient creates a scraper - local http client we use throughout the scraper subsystem .
// ignore insecure certificates // defaultCheckRedirect code with max changed from 10 to maxRedirects