fix: turn-off TLS redirects if configured (#574)

fixes #573
This commit is contained in:
Harshavardhana
2021-01-25 23:15:34 -08:00
committed by GitHub
parent 52fac7f542
commit 365778eecb
3 changed files with 33 additions and 23 deletions

View File

@@ -57,6 +57,11 @@ var serverCmd = cli.Command{
Value: restapi.GetTLSPort(),
Usage: "HTTPS server port",
},
cli.StringFlag{
Name: "tls-redirect",
Value: restapi.GetTLSRedirect(),
Usage: "HTTPS redirect by default",
},
cli.StringFlag{
Name: "certs-dir",
Value: certs.GlobalCertsCADir.Get(),
@@ -125,7 +130,7 @@ func startServer(ctx *cli.Context) error {
// Need to store tls-port, tls-host un config variables so secure.middleware can read from there
restapi.TLSPort = fmt.Sprintf("%v", ctx.Int("tls-port"))
restapi.TLSHostname = ctx.String("tls-host")
restapi.TLSRedirect = "on"
restapi.TLSRedirect = ctx.String("tls-redirect")
}
server.ConfigureAPI()