From dad7a987ae93a41751a069394dd6c53e92fec138 Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Tue, 21 May 2024 21:53:44 -0700 Subject: [PATCH] nosprintfhostport --- envconfig/config.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/envconfig/config.go b/envconfig/config.go index d6699451..875c9039 100644 --- a/envconfig/config.go +++ b/envconfig/config.go @@ -3,6 +3,7 @@ package envconfig import ( "fmt" "log/slog" + "net" "os" "path/filepath" "runtime" @@ -184,8 +185,8 @@ func LoadConfig() { AllowOrigins = append(AllowOrigins, fmt.Sprintf("http://%s", allowOrigin), fmt.Sprintf("https://%s", allowOrigin), - fmt.Sprintf("http://%s:*", allowOrigin), - fmt.Sprintf("https://%s:*", allowOrigin), + fmt.Sprintf("http://%s", net.JoinHostPort(allowOrigin, "*")), + fmt.Sprintf("https://%s", net.JoinHostPort(allowOrigin, "*")), ) }