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, ", "))