api: call NewURLApiWithClient from NewApiWithClient
This commit was moved from ipfs/go-ipfs-http-client@aea6890f36001f15d24a4b373979bb1b9bf81483
Alex committed
May 1, 2019 at 16:00 UTC
efe3b6054e8f62191e74e6664adec06c306c06aa
1 file changed
+1
-13
client/httpapi/api.go
+1
-13
@@ -109,19 +109,7 @@ func NewApiWithClient(a ma.Multiaddr, c *gohttp.Client) (*HttpApi, error) {
109
}
110
}
111
112
- api := &HttpApi{
113
- url: url,
114
- httpcli: *c,
115
- Headers: make(map[string][]string),
116
- applyGlobal: func(*RequestBuilder) {},
117
- }
118
-
119
- // We don't support redirects.
120
- api.httpcli.CheckRedirect = func(_ *gohttp.Request, _ []*gohttp.Request) error {
121
- return fmt.Errorf("unexpected redirect")
122
- }
123
-
124
- return api, nil
112
+ return NewURLApiWithClient(url, c)
113
}
114
115
func NewURLApiWithClient(url string, c *gohttp.Client) (*HttpApi, error) {