This commit is contained in:
Tomáš Dvořák
2025-10-05 10:11:25 +02:00
parent eeff13d5bb
commit 30e180886d
2 changed files with 22 additions and 5 deletions
+5 -5
View File
@@ -38,13 +38,13 @@ func main() {
r := gin.Default()
r.MaxMultipartMemory = 32 << 20 // 32 MB
// CORS middleware
// CORS middleware - Allow all origins, methods, and headers
r.Use(cors.New(cors.Config{
AllowOrigins: []string{"*"},
AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
AllowHeaders: []string{"Origin", "Content-Type", "Accept", "Authorization"},
ExposeHeaders: []string{"Content-Length"},
AllowCredentials: true,
AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH", "HEAD"},
AllowHeaders: []string{"*"},
ExposeHeaders: []string{"*"},
AllowCredentials: false, // Must be false when using wildcard origins
AllowOriginFunc: func(origin string) bool {
return true // Allow all origins
},