RoundTrip implements http.RoundTripper.
(req *http.Request)
| 105 | |
| 106 | // RoundTrip implements http.RoundTripper. |
| 107 | func (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 |
nothing calls this directly
no test coverage detected