MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / HttpClient

Function HttpClient

internal/net/serve.go:272–284  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

270var httpClient *http.Client
271
272func HttpClient() *http.Client {
273 once.Do(func() {
274 httpClient = NewHttpClient()
275 httpClient.CheckRedirect = func(req *http.Request, via []*http.Request) error {
276 if len(via) >= 10 {
277 return errors.New("stopped after 10 redirects")
278 }
279 req.Header.Del("Referer")
280 return nil
281 }
282 })
283 return httpClient
284}
285
286func NewHttpClient() *http.Client {
287 transport := &http.Transport{

Callers 2

RunMethod · 0.92
RequestHttpFunction · 0.85

Calls 3

NewHttpClientFunction · 0.85
DoMethod · 0.65
DelMethod · 0.65

Tested by

no test coverage detected