diff options
author | tjpcc <tjp@ctrl-c.club> | 2023-10-30 11:06:16 -0600 |
---|---|---|
committer | tjpcc <tjp@ctrl-c.club> | 2023-10-30 11:06:16 -0600 |
commit | da5fec925272ff8fea313870f914c2fc554c16fa (patch) | |
tree | c25f1af84b72c982823050ace289bb7f21e1e78a /client.go | |
parent | ea2d615351ff8517852e03a1223bd70db5285472 (diff) |
multi-client/http bugfixes
Diffstat (limited to 'client.go')
-rw-r--r-- | client.go | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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") != "" } |