Skip to content

Some following up changes for routes #30550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions routers/web/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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)
})
}