diff --git a/internal/api/api.go b/internal/api/api.go index b284a44..45e83e8 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -76,7 +76,10 @@ func Start(cfg *config.Config) error { // Catch panics and return a 500 router.Use(gin.Recovery()) // Configure CORS - router.Use(cors.Default()) + corsConfig := cors.DefaultConfig() + corsConfig.AllowAllOrigins = true + corsConfig.AllowHeaders = []string{"hx-current-url","hx-request","hx-target","hx-trigger"} + router.Use(cors.New(corsConfig)) // Access logging accessLogger := logging.GetAccessLogger() skipPaths := []string{} @@ -111,7 +114,7 @@ func Start(cfg *config.Config) error { // Metrics metricsRouter := gin.New() // Configure CORS - metricsRouter.Use(cors.Default()) + metricsRouter.Use(cors.New(corsConfig)) metrics := ginmetrics.GetMonitor() // Set metrics path metrics.SetMetricPath("/")