Default TLS redirect if Console runs with HTTPS (#580)

TLS redirect default behavior is `TRUE` only if Console is running with
HTTPS
This commit is contained in:
Lenin Alevski
2021-01-26 22:08:21 -06:00
committed by GitHub
parent 365778eecb
commit 3b1449c029

View File

@@ -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(),