first working version
This commit is contained in:
parent
398ff981d1
commit
39cae64854
8 changed files with 23 additions and 16 deletions
|
|
@ -168,10 +168,10 @@ func (c *Client) FollowRedirect(r *http.Request, v any, delay time.Duration) (re
|
|||
rr := r
|
||||
for {
|
||||
resp, err = c.Do(rr, v)
|
||||
if !errors.Is(ErrRedirect, err) {
|
||||
rdr, ok := err.(Redirect)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
rdr := err.(Redirect)
|
||||
rr, err = c.NewRequest(r.Context(), "GET", rdr.Location, nil)
|
||||
if err != nil {
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue