aboutsummaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--main.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/main.go b/main.go
index 41ef02f..037963b 100644
--- a/main.go
+++ b/main.go
@@ -109,8 +109,12 @@ func newServer(lc fx.Lifecycle, cfg *config.Config, db *gorm.DB, notifier *notif
WriteTimeout: cfg.Server.WriteTimeout,
}
config := cors.DefaultConfig()
- config.AllowAllOrigins = !cfg.IsDoneTickDotCom
- config.AllowOrigins = cfg.Server.CorsAllowOrigins
+ if cfg.IsDoneTickDotCom {
+ config.AllowOrigins = cfg.Server.CorsAllowOrigins
+ } else {
+ config.AllowAllOrigins = true
+ }
+
config.AllowCredentials = true
config.AddAllowHeaders("Authorization", "secretkey")
r.Use(cors.New(config))