Skip to content

Commit

Permalink
Replaced complex condition with already defined serveTLS
Browse files Browse the repository at this point in the history
  • Loading branch information
KenyC committed Oct 31, 2024
1 parent efec37e commit 1c45049
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/serve/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (c *command) Run(ctx context.Context) error {

hostname := "localhost" // default hostname
protocol := "http"
if *c.tlsCertPath != "" && *c.tlsKeyPath != "" {
if serveTLS {
protocol = "https"
}
baseURL := fmt.Sprintf("%s://%s:%d", protocol, hostname, *c.port)
Expand Down

0 comments on commit 1c45049

Please sign in to comment.