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

Method RoundTrip

internal/cmdutil/transport.go:107–122  ·  view source on GitHub ↗

RoundTrip implements http.RoundTripper.

(req *http.Request)

Source from the content-addressed store, hash-verified

105
106// RoundTrip implements http.RoundTripper.
107func (t *SecurityHeaderTransport) RoundTrip(req *http.Request) (*http.Response, error) {
108 req = req.Clone(req.Context())
109 for k, vs := range BaseSecurityHeaders() {
110 for _, v := range vs {
111 req.Header.Set(k, v)
112 }
113 }
114 // Shortcut headers are propagated via context (see section 5.6 of the design doc).
115 if name, ok := ShortcutNameFromContext(req.Context()); ok {
116 req.Header.Set(HeaderShortcut, name)
117 }
118 if eid, ok := ExecutionIdFromContext(req.Context()); ok {
119 req.Header.Set(HeaderExecutionId, eid)
120 }
121 return t.base().RoundTrip(req)
122}
123
124// extensionMiddleware wraps the built-in transport chain with pre/post hooks.
125// The built-in chain always executes unless the extension is an

Callers

nothing calls this directly

Calls 7

baseMethod · 0.95
BaseSecurityHeadersFunction · 0.85
ShortcutNameFromContextFunction · 0.85
ExecutionIdFromContextFunction · 0.85
CloneMethod · 0.80
SetMethod · 0.65
RoundTripMethod · 0.45

Tested by

no test coverage detected