We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c559a9f commit 42f964fCopy full SHA for 42f964f
routers/routes/routes.go
@@ -38,6 +38,7 @@ import (
38
"github.com/go-macaron/binding"
39
"github.com/go-macaron/cache"
40
"github.com/go-macaron/captcha"
41
+ "github.com/go-macaron/cors"
42
"github.com/go-macaron/csrf"
43
"github.com/go-macaron/i18n"
44
"github.com/go-macaron/session"
@@ -131,6 +132,9 @@ func NewMacaron() *macaron.Macaron {
131
132
if setting.Protocol == setting.FCGI {
133
m.SetURLPrefix(setting.AppSubURL)
134
}
135
+ if setting.EnableCORS {
136
+ m.Use(cors.CORS(setting.CORSConfig))
137
+ }
138
m.Use(public.Custom(
139
&public.Options{
140
SkipLogging: setting.DisableRouterLog,
0 commit comments