diff --git a/routers/web/status.go b/routers/web/status.go index fe885a29cd..94aaf34b83 100644 --- a/routers/web/status.go +++ b/routers/web/status.go @@ -61,5 +61,7 @@ func UserStatus(ctx *context.Context) { if ctx.IsSigned { ctx.Data["UserName"] = ctx.Doer.DisplayName() } + + ctx.Resp.Header().Add("Access-Control-Allow-Origin", "*") ctx.HTML(http.StatusOK, tplStatus) } diff --git a/routers/web/web.go b/routers/web/web.go index 5d57efad82..ae424aeeba 100644 --- a/routers/web/web.go +++ b/routers/web/web.go @@ -431,7 +431,8 @@ func registerRoutes(m *web.Route) { // Especially some AJAX requests, we can reduce middleware number to improve performance. m.Get("/", Home) - m.Get("/status", UserStatus) + //m.Get("/status", UserStatus) + m.Methods("GET, HEAD, OPTIONS", "/status", UserStatus, optionsCorsHandler()) m.Get("/sitemap.xml", sitemapEnabled, ignExploreSignIn, HomeSitemap) m.Group("/.well-known", func() { m.Get("/openid-configuration", auth.OIDCWellKnown)