summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortjpcc <tjp@ctrl-c.club>2023-10-30 11:06:16 -0600
committertjpcc <tjp@ctrl-c.club>2023-10-30 11:06:16 -0600
commitda5fec925272ff8fea313870f914c2fc554c16fa (patch)
treec25f1af84b72c982823050ace289bb7f21e1e78a
parentea2d615351ff8517852e03a1223bd70db5285472 (diff)
multi-client/http bugfixes
-rw-r--r--client.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/client.go b/client.go
index 145b2f8..26fed10 100644
--- a/client.go
+++ b/client.go
@@ -123,7 +123,8 @@ type httpClient struct {
}
func (hc httpClient) RoundTrip(request *Request) (*Response, error) {
- hreq, err := http.NewRequest("GET", request.URL.String(), request.Meta.(*io.LimitedReader))
+ body, _ := request.Meta.(io.Reader)
+ hreq, err := http.NewRequest("GET", request.URL.String(), body)
if err != nil {
return nil, err
}
@@ -141,5 +142,5 @@ func (hc httpClient) RoundTrip(request *Request) (*Response, error) {
}
func (hc httpClient) IsRedirect(response *Response) bool {
- return response.Meta.(*http.Request).Header.Get("Location") != ""
+ return response.Meta.(*http.Response).Header.Get("Location") != ""
}