Skip to content

Commit

Permalink
Don't follow redirects
Browse files Browse the repository at this point in the history
This change is part of openfaas/faas#925
which prevents redirects from being followed on the server-side
and means a function can allow the caller / client to follow
the redirect as intended.

Signed-off-by: Alex Ellis (VMware) <[email protected]>
  • Loading branch information
alexellis committed Oct 19, 2018
1 parent 39739dc commit 1ac9c41
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions executor/http_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ func makeProxyClient(dialTimeout time.Duration) *http.Client {
IdleConnTimeout: 500 * time.Millisecond,
ExpectContinueTimeout: 1500 * time.Millisecond,
},
CheckRedirect: func(req *http.Request, via []*http.Request) error {
return http.ErrUseLastResponse
},
}

return &proxyClient
Expand Down

0 comments on commit 1ac9c41

Please sign in to comment.