From 6e539b448f24b4fe60cd7004b099048adfba2093 Mon Sep 17 00:00:00 2001 From: Nico Benninger Date: Thu, 31 Oct 2024 13:25:28 +0100 Subject: [PATCH] feat: origin update --- cors.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cors.go b/cors.go index fae7f24..fea11f3 100644 --- a/cors.go +++ b/cors.go @@ -137,7 +137,7 @@ func CorsMiddleware(config Config) gin.HandlerFunc { } // Headers for all requests - c.Writer.Header().Set("Access-Control-Allow-Origin", strings.Join(config.AllowedOrigins, ", ")) + c.Writer.Header().Set("Access-Control-Allow-Origin", currentOrigin) c.Writer.Header().Set("Access-Control-Allow-Credentials", strconv.FormatBool(config.AllowCredentials)) c.Writer.Header().Set("Access-Control-Expose-Headers", strings.Join(config.ExposeHeaders, ", "))