Change AllowOrigin from everything to Svelte frontend

This commit is contained in:
qowevisa 2024-11-06 19:43:43 +02:00
parent fdc3ca101c
commit bfa8445f78

View File

@ -32,7 +32,7 @@ func main() {
r := gin.Default() r := gin.Default()
docs.SwaggerInfo.BasePath = "/api" docs.SwaggerInfo.BasePath = "/api"
r.Use(cors.New(cors.Config{ r.Use(cors.New(cors.Config{
AllowOrigins: []string{"*"}, AllowOrigins: []string{"http://localhost:5173"},
AllowMethods: []string{"GET", "DELETE", "PUT", "PATCH", "OPTIONS"}, AllowMethods: []string{"GET", "DELETE", "PUT", "PATCH", "OPTIONS"},
AllowHeaders: []string{"Origin", "Content-Type"}, AllowHeaders: []string{"Origin", "Content-Type"},
ExposeHeaders: []string{"Content-Length"}, ExposeHeaders: []string{"Content-Length"},