Quellcode durchsuchen

add cors support for static resources

pull/6341/head
Lunny Xiao vor 4 Jahren
Ursprung
Commit
42f964fd18
Es ist kein Account mit der E-Mail-Adresse des Committers verbunden
1 geänderte Dateien mit 4 neuen und 0 gelöschten Zeilen
  1. 4
    0
      routers/routes/routes.go

+ 4
- 0
routers/routes/routes.go Datei anzeigen

@@ -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,

Laden…
Abbrechen
Speichern