Skip to content

Commit

Permalink
Fix previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
erikdubbelboer committed Oct 2, 2019
1 parent 5038ebc commit 28af1f1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,8 @@ func doRequestFollowRedirects(req *Request, dst []byte, url string, c clientDoer
if err = c.Do(req, resp); err != nil {
break
}
if !StatusCodeIsRedirect(resp.Header.StatusCode()) {
statusCode = resp.Header.StatusCode()
if !StatusCodeIsRedirect(statusCode) {
break
}

Expand Down Expand Up @@ -859,8 +860,6 @@ func getRedirectURL(baseURL string, location []byte) string {
return redirectURL
}

// StatusCodeIsRedirect checks the response code.
//
// StatusCodeIsRedirect returns true if the status code indicates a redirect.
func StatusCodeIsRedirect(statusCode int) bool {
return statusCode == StatusMovedPermanently ||
Expand Down

0 comments on commit 28af1f1

Please sign in to comment.