Skip to content

Commit 1ac9c41

Browse files
committed
Don't follow redirects
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]>
1 parent 39739dc commit 1ac9c41

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

executor/http_runner.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ func makeProxyClient(dialTimeout time.Duration) *http.Client {
176176
IdleConnTimeout: 500 * time.Millisecond,
177177
ExpectContinueTimeout: 1500 * time.Millisecond,
178178
},
179+
CheckRedirect: func(req *http.Request, via []*http.Request) error {
180+
return http.ErrUseLastResponse
181+
},
179182
}
180183

181184
return &proxyClient

0 commit comments

Comments
 (0)