mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-15 23:38:04 +00:00
add cors support for static resources
This commit is contained in:
parent
c559a9f824
commit
42f964fd18
1 changed files with 4 additions and 0 deletions
|
@ -38,6 +38,7 @@ import (
|
|||
"github.com/go-macaron/binding"
|
||||
"github.com/go-macaron/cache"
|
||||
"github.com/go-macaron/captcha"
|
||||
"github.com/go-macaron/cors"
|
||||
"github.com/go-macaron/csrf"
|
||||
"github.com/go-macaron/i18n"
|
||||
"github.com/go-macaron/session"
|
||||
|
@ -131,6 +132,9 @@ func NewMacaron() *macaron.Macaron {
|
|||
if setting.Protocol == setting.FCGI {
|
||||
m.SetURLPrefix(setting.AppSubURL)
|
||||
}
|
||||
if setting.EnableCORS {
|
||||
m.Use(cors.CORS(setting.CORSConfig))
|
||||
}
|
||||
m.Use(public.Custom(
|
||||
&public.Options{
|
||||
SkipLogging: setting.DisableRouterLog,
|
||||
|
|
Loading…
Reference in a new issue