File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ func SendVia(req Request, svc Service) *ResponseFuture {
106
106
// Send round-trips the request via the default Client. It does not block, instead returning a ResponseFuture
107
107
// representing the asynchronous operation to produce the response. It is equivalent to:
108
108
//
109
- // SendVia(req, Client)
109
+ // SendVia(req, Client)
110
110
func Send (req Request ) * ResponseFuture {
111
111
return SendVia (req , Client )
112
112
}
@@ -123,10 +123,14 @@ func isH2C(ctx context.Context) bool {
123
123
return b
124
124
}
125
125
126
+ func isHTTP (r * http.Request ) bool {
127
+ return r .URL != nil && r .URL .Scheme == "http"
128
+ }
129
+
126
130
type dynamicRoundTripper struct {}
127
131
128
132
func (d dynamicRoundTripper ) RoundTrip (r * http.Request ) (* http.Response , error ) {
129
- if r . URL . Scheme == "http" && isH2C (r .Context ()) {
133
+ if isHTTP ( r ) && isH2C (r .Context ()) {
130
134
return H2cRoundTripper .RoundTrip (r )
131
135
}
132
136
return HTTPRoundTripper .RoundTrip (r )
You can’t perform that action at this time.
0 commit comments