MCPcopy
hub / github.com/cli/cli / RoundTrip

Method RoundTrip

pkg/cmd/agent-task/capi/client.go:64–77  ·  view source on GitHub ↗
(req *http.Request)

Source from the content-addressed store, hash-verified

62}
63
64func (ct *capiTransport) RoundTrip(req *http.Request) (*http.Response, error) {
65 req.Header.Set("Authorization", "Bearer "+ct.token)
66
67 // Since this RoundTrip is reused for both Copilot API and
68 // GitHub API requests, we conditionally add the integration
69 // ID only when performing requests to the Copilot API.
70 if req.URL.Host == ct.capiHost {
71 req.Header.Add("Copilot-Integration-Id", "copilot-4-cli")
72
73 // Ensure we are not using GitHub API versions while targeting CAPI.
74 req.Header.Set("X-GitHub-Api-Version", "2026-01-09")
75 }
76 return ct.rp.RoundTrip(req)
77}

Callers

nothing calls this directly

Calls 2

SetMethod · 0.65
AddMethod · 0.65

Tested by

no test coverage detected