From 3b1449c029a09af95727cb387159b47e01feab87 Mon Sep 17 00:00:00 2001 From: Lenin Alevski Date: Tue, 26 Jan 2021 22:08:21 -0600 Subject: [PATCH] Default TLS redirect if Console runs with HTTPS (#580) TLS redirect default behavior is `TRUE` only if Console is running with HTTPS --- restapi/configure_console.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/restapi/configure_console.go b/restapi/configure_console.go index 920bb635e..f31529029 100644 --- a/restapi/configure_console.go +++ b/restapi/configure_console.go @@ -189,7 +189,7 @@ func setupGlobalMiddleware(handler http.Handler) http.Handler { AllowedHosts: getSecureAllowedHosts(), AllowedHostsAreRegex: getSecureAllowedHostsAreRegex(), HostsProxyHeaders: getSecureHostsProxyHeaders(), - SSLRedirect: GetTLSRedirect() == "on", + SSLRedirect: GetTLSRedirect() == "on" && len(GlobalPublicCerts) > 0, SSLHost: getSecureTLSHost(), STSSeconds: getSecureSTSSeconds(), STSIncludeSubdomains: getSecureSTSIncludeSubdomains(),