MCPcopy
hub / github.com/projectdiscovery/uncover / Do

Method Do

sources/session.go:110–126  ·  view source on GitHub ↗
(request *retryablehttp.Request, source string)

Source from the content-addressed store, hash-verified

108}
109
110func (s *Session) Do(request *retryablehttp.Request, source string) (*http.Response, error) {
111 err := s.RateLimits.Take(source)
112 if err != nil {
113 return nil, err
114 }
115 // close request connection (does not reuse connections)
116 request.Close = true
117 resp, err := s.Client.Do(request)
118 if err != nil {
119 return nil, err
120 }
121 if resp.StatusCode != http.StatusOK {
122 requestURL, _ := url.QueryUnescape(request.String())
123 return resp, fmt.Errorf("unexpected status code %d received from %s", resp.StatusCode, requestURL)
124 }
125 return resp, nil
126}

Callers 15

TestSessionRetryFunction · 0.95
queryMethod · 0.80
queryURLMethod · 0.80
queryURLMethod · 0.80
queryURLMethod · 0.80
queryURLMethod · 0.80
queryURLMethod · 0.80
queryMethod · 0.80
queryURLMethod · 0.80
queryURLMethod · 0.80
queryURLMethod · 0.80
queryURLMethod · 0.80

Calls

no outgoing calls

Tested by 1

TestSessionRetryFunction · 0.76