From a7b832e29e62995427d6903b1ec204645429488d Mon Sep 17 00:00:00 2001 From: stavhaygn Date: Sun, 23 Apr 2023 20:29:57 +0800 Subject: [PATCH] Fix CORS middleware check for allowed origins --- internal/common/server/http.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/common/server/http.go b/internal/common/server/http.go index 58f0d15..dc541b4 100644 --- a/internal/common/server/http.go +++ b/internal/common/server/http.go @@ -80,7 +80,7 @@ func addAuthMiddleware(router *chi.Mux) { func addCorsMiddleware(router *chi.Mux) { allowedOrigins := strings.Split(os.Getenv("CORS_ALLOWED_ORIGINS"), ";") - if len(allowedOrigins) == 0 { + if len(allowedOrigins) == 1 && allowedOrigins[0] == "" { return }