Fix wrong middleware sequence (#26428)

This commit is contained in:
Lunny Xiao 2023-08-10 18:51:46 +08:00 committed by GitHub
parent a370efc13f
commit e7cbb0e7c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1131,7 +1131,7 @@ func registerRoutes(m *web.Route) {
m.Get(".atom", feedEnabled, repo.ReleasesFeedAtom)
}, ctxDataSet("EnableFeed", setting.Other.EnableFeed),
repo.MustBeNotEmpty, reqRepoReleaseReader, context.RepoRefByType(context.RepoRefTag, true))
m.Get("/releases/attachments/{uuid}", repo.GetAttachment, repo.MustBeNotEmpty, reqRepoReleaseReader)
m.Get("/releases/attachments/{uuid}", repo.MustBeNotEmpty, reqRepoReleaseReader, repo.GetAttachment)
m.Group("/releases", func() {
m.Get("/new", repo.NewRelease)
m.Post("/new", web.Bind(forms.NewReleaseForm{}), repo.NewReleasePost)