From cd9066f4600c1ca1cf96daa158131db75c033881 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Thu, 18 Apr 2024 09:15:26 +0800 Subject: [PATCH] fix --- routers/web/web.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/routers/web/web.go b/routers/web/web.go index f9164568ed1f4..a6a4c1d987e35 100644 --- a/routers/web/web.go +++ b/routers/web/web.go @@ -54,10 +54,7 @@ import ( "github.com/prometheus/client_golang/prometheus" ) -const ( - // GzipMinSize represents min size to compress for the body size of response - GzipMinSize = 1400 -) +const GzipMinSize = 1400 // min size to compress for the body size of response // optionsCorsHandler return a http handler which sets CORS options if enabled by config, it blocks non-CORS OPTIONS requests. func optionsCorsHandler() func(next http.Handler) http.Handler { @@ -1115,7 +1112,7 @@ func registerRoutes(m *web.Route) { m.Post("/cancel", repo.MigrateCancelPost) }) }, - reqSignIn, context.RepoAssignment, context.RepoRef(), reqRepoAdmin, + reqSignIn, context.RepoAssignment, reqRepoAdmin, context.RepoRef(), ctxDataSet("PageIsRepoSettings", true, "LFSStartServer", setting.LFS.StartServer), ) // end "/{username}/{reponame}/settings" @@ -1613,6 +1610,7 @@ func registerRoutes(m *web.Route) { m.NotFound(func(w http.ResponseWriter, req *http.Request) { ctx := context.GetWebContext(req) + routing.UpdateFuncInfo(ctx, routing.GetFuncInfo(ctx.NotFound, "GlobalNotFound")) ctx.NotFound("", nil) }) }