Skip to content

Commit

Permalink
prevent client from following redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenhillier committed Jul 31, 2019
1 parent 776bb35 commit d19086d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ func request(request Request, count int, env Environment, verbose bool) error {

// set up request and client
var req *http.Request
client := &http.Client{}
client := &http.Client{
CheckRedirect: func(req *http.Request, via []*http.Request) error {
// Do not follow redirects
return http.ErrUseLastResponse
},
}

// If values are passed in by the "urlencoded" field, treat the request
// as x-www-form-urlencoded
Expand Down

0 comments on commit d19086d

Please sign in to comment.