mirror of
https://github.com/openfaas/faas.git
synced 2025-06-14 11:16:47 +00:00
Don't follow redirects from functions
- Covers part of 919 by making the HTTP client used for proxying stop following redirects. Tested with a stateless microservice, but additional code changes may be requierd in the queue-worker, the watchdogs and other areas. Tested on Swarm with stateless microservice (Node.js) issuing a redirect via Location header. Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
This commit is contained in:
parent
31e5439550
commit
62525f6570
@ -28,7 +28,11 @@ func NewHTTPClientReverseProxy(baseURL *url.URL, timeout time.Duration) *HTTPCli
|
||||
ExpectContinueTimeout: 1500 * time.Millisecond,
|
||||
},
|
||||
Timeout: timeout,
|
||||
CheckRedirect: func(req *http.Request, via []*http.Request) error {
|
||||
return http.ErrUseLastResponse
|
||||
},
|
||||
}
|
||||
|
||||
return &h
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user