Skip to content

Commit 6bffaf5

Browse files
author
Gusted
committed
Move /info outside authorization
- To use the web's API to get information about a issue/pull on a repository, doesn't require authorization(nor that the repository isn't archived). - Regressed by: go-gitea#19318
1 parent d0a2c1e commit 6bffaf5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

routers/web/web.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,11 @@ func RegisterRoutes(m *web.Route) {
835835
m.Combo("/compare/*", repo.MustBeNotEmpty, reqRepoCodeReader, repo.SetEditorconfigIfExists).
836836
Get(ignSignIn, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.CompareDiff).
837837
Post(reqSignIn, context.RepoMustNotBeArchived(), reqRepoPullsReader, repo.MustAllowPulls, bindIgnErr(forms.CreateIssueForm{}), repo.SetWhitespaceBehavior, repo.CompareAndPullRequestPost)
838+
m.Group("/{type:issues|pulls}", func() {
839+
m.Group("/{index}", func() {
840+
m.Get("/info", repo.GetIssueInfo)
841+
})
842+
})
838843
}, context.RepoAssignment, context.UnitTypes())
839844

840845
// Grouping for those endpoints that do require authentication
@@ -851,7 +856,6 @@ func RegisterRoutes(m *web.Route) {
851856
// So they can apply their own enable/disable logic on routers.
852857
m.Group("/{type:issues|pulls}", func() {
853858
m.Group("/{index}", func() {
854-
m.Get("/info", repo.GetIssueInfo)
855859
m.Post("/title", repo.UpdateIssueTitle)
856860
m.Post("/content", repo.UpdateIssueContent)
857861
m.Post("/deadline", bindIgnErr(structs.EditDeadlineOption{}), repo.UpdateIssueDeadline)

0 commit comments

Comments
 (0)