X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/a93ef946eb1e73ee190ea4ff19c4f9278235530c..bef56b9a22efac9ce73006623080e84a0b57f243:/lib/controller/handler.go diff --git a/lib/controller/handler.go b/lib/controller/handler.go index 69b1866162..25799aae9e 100644 --- a/lib/controller/handler.go +++ b/lib/controller/handler.go @@ -58,6 +58,8 @@ func (h *Handler) CheckHealth() error { return err } +func neverRedirect(*http.Request, []*http.Request) error { return http.ErrUseLastResponse } + func (h *Handler) setup() { mux := http.NewServeMux() mux.Handle("/_health/", &health.Handler{ @@ -72,21 +74,18 @@ func (h *Handler) setup() { sc := *arvados.DefaultSecureClient sc.Timeout = time.Duration(h.Cluster.HTTPRequestTimeout) + sc.CheckRedirect = neverRedirect h.secureClient = &sc ic := *arvados.InsecureHTTPClient ic.Timeout = time.Duration(h.Cluster.HTTPRequestTimeout) + ic.CheckRedirect = neverRedirect h.insecureClient = &ic h.proxy = &proxy{ Name: "arvados-controller", RequestTimeout: time.Duration(h.Cluster.HTTPRequestTimeout), } - - // Changing the global isn't the right way to do this, but a - // proper solution would conflict with an impending 13493 - // merge anyway, so this will do for now. - arvados.InsecureHTTPClient.CheckRedirect = func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse } } var errDBConnection = errors.New("database connection error")