(base http.RoundTripper, headers http.Header)
| 131 | } |
| 132 | |
| 133 | func newCustomHeaderTransport(base http.RoundTripper, headers http.Header) http.RoundTripper { |
| 134 | if base == nil { |
| 135 | base = http.DefaultTransport |
| 136 | } |
| 137 | return &customHeaderTransport{ |
| 138 | base: base, |
| 139 | headers: headers.Clone(), |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | func (t *customHeaderTransport) RoundTrip(req *http.Request) (*http.Response, error) { |
| 144 | req = req.Clone(req.Context()) |
no outgoing calls