MCPcopy Index your code
hub / github.com/chainreactors/EvilProxy / pluginStoreGetNoRedirect

Function pluginStoreGetNoRedirect

internal/pluginstore/github.go:187–201  ·  view source on GitHub ↗
(ctx context.Context, client HTTPDoer, requestURL string, headers http.Header)

Source from the content-addressed store, hash-verified

185}
186
187func pluginStoreGetNoRedirect(ctx context.Context, client HTTPDoer, requestURL string, headers http.Header) (*http.Response, error) {
188 if client == nil {
189 client = http.DefaultClient
190 }
191 req, errRequest := http.NewRequestWithContext(ctx, http.MethodGet, requestURL, nil)
192 if errRequest != nil {
193 return nil, fmt.Errorf("create request: %w", errRequest)
194 }
195 req.Header = headers.Clone()
196 resp, errDo := pluginStoreNoRedirectClient(client).Do(req)
197 if errDo != nil {
198 return nil, fmt.Errorf("request failed: %w", errDo)
199 }
200 return resp, nil
201}
202
203func pluginStoreNoRedirectClient(client HTTPDoer) HTTPDoer {
204 httpClient, ok := client.(*http.Client)

Callers 1

getMethod · 0.85

Calls 3

DoMethod · 0.65
CloneMethod · 0.45

Tested by

no test coverage detected