...
1 package ldclient
2
3 import (
4 "net/http"
5 )
6
7 type urlAppendingHTTPTransport string
8
9 func urlAppendingHTTPClientFactory(suffix string) func(Config) http.Client {
10 return func(Config) http.Client {
11 return http.Client{Transport: urlAppendingHTTPTransport(suffix)}
12 }
13 }
14
15 func (t urlAppendingHTTPTransport) RoundTrip(r *http.Request) (*http.Response, error) {
16 req := *r
17 req.URL.Path = req.URL.Path + string(t)
18 return http.DefaultTransport.RoundTrip(&req)
19 }
20
View as plain text