From 9684d34ad0b534e6a54af4eacb6da72a7e0d49d2 Mon Sep 17 00:00:00 2001 From: mohit-nagaraj Date: Fri, 11 Oct 2024 15:11:13 +0530 Subject: [PATCH] Revert "refactor: fix check for empty string" This reverts commit 949198d09ea16494c62d79759bba4da5eeb5463e. --- extra/healthcheck.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/extra/healthcheck.go b/extra/healthcheck.go index 9687a6630..f79b3e65b 100644 --- a/extra/healthcheck.go +++ b/extra/healthcheck.go @@ -32,20 +32,20 @@ func main() { } sslKey := os.Getenv("UPTIME_KUMA_SSL_KEY") - if sslKey == "" { + if len(sslKey) == 0 { sslKey = os.Getenv("SSL_KEY") } sslCert := os.Getenv("UPTIME_KUMA_SSL_CERT") - if sslCert == "" { + if len(sslCert) == 0 { sslCert = os.Getenv("SSL_CERT") } hostname := os.Getenv("UPTIME_KUMA_HOST") - if hostname == "" && !isFreeBSD { + if len(hostname) == 0 && !isFreeBSD { hostname = os.Getenv("HOST") } - if hostname == "" { + if len(hostname) == 0 { hostname = "127.0.0.1" } @@ -54,15 +54,15 @@ func main() { if !isK8s { port = os.Getenv("UPTIME_KUMA_PORT") } - if port == "" { + if len(port) == 0 { port = os.Getenv("PORT") } - if port == "" { + if len(port) == 0 { port = "3001" } protocol := "" - if sslKey != "" && sslCert != "" { + if len(sslKey) != 0 && len(sslCert) != 0 { protocol = "https" } else { protocol = "http"