Skip to content

Commit 9e248b5

Browse files
committed
fix
1 parent 81aec6d commit 9e248b5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

routers/web/web.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1524,7 +1524,10 @@ func registerRoutes(m *web.Router) {
15241524
}, context.RepoMustNotBeArchived())
15251525
})
15261526
}, repo.MustAllowPulls)
1527+
}, ignSignIn, context.RepoAssignment, context.RequireRepoReaderOr(unit.TypeCode, unit.TypePullRequests))
1528+
// end "/{username}/{reponame}": pull request view/edit
15271529

1530+
m.Group("/pulls/{index}", func() {
15281531
m.Group("/media", func() {
15291532
m.Get("/branch/*", context.RepoRefByType(context.RepoRefBranch), repo.SingleDownloadOrLFS)
15301533
m.Get("/tag/*", context.RepoRefByType(context.RepoRefTag), repo.SingleDownloadOrLFS)
@@ -1585,7 +1588,7 @@ func registerRoutes(m *web.Router) {
15851588
m.Get("/commit/{sha:([a-f0-9]{7,64})}.{ext:patch|diff}", repo.MustBeNotEmpty, repo.RawDiff)
15861589
m.Post("/lastcommit/*", context.RepoRefByType(context.RepoRefCommit), repo.LastCommit)
15871590
}, ignSignIn, context.RepoAssignment, reqRepoCodeReader)
1588-
// end "/{username}/{reponame}": repo code
1591+
// end "/{username}/{reponame}": pull request code
15891592

15901593
m.Group("/{username}/{reponame}", func() {
15911594
m.Get("/stars", repo.Stars)

0 commit comments

Comments
 (0)