File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,10 @@ func Start(cfg *config.Config) error {
7676 // Catch panics and return a 500
7777 router .Use (gin .Recovery ())
7878 // Configure CORS
79- router .Use (cors .Default ())
79+ corsConfig := cors .DefaultConfig ()
80+ corsConfig .AllowAllOrigins = true
81+ corsConfig .AllowHeaders = []string {"hx-current-url" ,"hx-request" ,"hx-target" ,"hx-trigger" }
82+ router .Use (cors .New (corsConfig ))
8083 // Access logging
8184 accessLogger := logging .GetAccessLogger ()
8285 skipPaths := []string {}
@@ -111,7 +114,7 @@ func Start(cfg *config.Config) error {
111114 // Metrics
112115 metricsRouter := gin .New ()
113116 // Configure CORS
114- metricsRouter .Use (cors .Default ( ))
117+ metricsRouter .Use (cors .New ( corsConfig ))
115118 metrics := ginmetrics .GetMonitor ()
116119 // Set metrics path
117120 metrics .SetMetricPath ("/" )
You can’t perform that action at this time.
0 commit comments