aboutsummaryrefslogtreecommitdiffstats
path: root/routers/routes
diff options
context:
space:
mode:
Diffstat (limited to 'routers/routes')
-rw-r--r--routers/routes/routes.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/routers/routes/routes.go b/routers/routes/routes.go
index a0684c8478..c5d6793ff3 100644
--- a/routers/routes/routes.go
+++ b/routers/routes/routes.go
@@ -419,8 +419,10 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Post("/create", bindIgnErr(auth.CreateRepoForm{}), repo.CreatePost)
m.Get("/migrate", repo.Migrate)
m.Post("/migrate", bindIgnErr(auth.MigrateRepoForm{}), repo.MigratePost)
- m.Combo("/fork/:repoid").Get(repo.Fork).
- Post(bindIgnErr(auth.CreateRepoForm{}), repo.ForkPost)
+ m.Group("/fork", func() {
+ m.Combo("/:repoid").Get(repo.Fork).
+ Post(bindIgnErr(auth.CreateRepoForm{}), repo.ForkPost)
+ }, context.RepoIDAssignment(), context.UnitTypes(), context.LoadRepoUnits(), context.CheckUnit(models.UnitTypeCode))
}, reqSignIn)
m.Group("/:username/:reponame", func() {