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