MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / HttpRequest

Method HttpRequest

sdk/cliproxy/auth/conductor.go:5804–5823  ·  view source on GitHub ↗

HttpRequest injects provider credentials into the supplied HTTP request and executes it.

(ctx context.Context, auth *Auth, req *http.Request)

Source from the content-addressed store, hash-verified

5802
5803// HttpRequest injects provider credentials into the supplied HTTP request and executes it.
5804func (m *Manager) HttpRequest(ctx context.Context, auth *Auth, req *http.Request) (*http.Response, error) {
5805 if m == nil {
5806 return nil, &Error{Code: "provider_not_found", Message: "manager is nil"}
5807 }
5808 if auth == nil {
5809 return nil, &Error{Code: "auth_not_found", Message: "auth is nil"}
5810 }
5811 if req == nil {
5812 return nil, &Error{Code: "invalid_request", Message: "http request is nil"}
5813 }
5814 providerKey := executorKeyFromAuth(auth)
5815 if providerKey == "" {
5816 return nil, &Error{Code: "provider_not_found", Message: "auth provider is empty"}
5817 }
5818 exec := m.executorFor(providerKey)
5819 if exec == nil {
5820 return nil, &Error{Code: "provider_not_found", Message: "executor not registered for provider: " + providerKey}
5821 }
5822 return exec.HttpRequest(ctx, auth, req)
5823}

Callers 1

mainFunction · 0.95

Calls 3

executorForMethod · 0.95
executorKeyFromAuthFunction · 0.85
HttpRequestMethod · 0.65

Tested by

no test coverage detected