diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index 73338e51b..42de8d248 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -583,7 +583,7 @@ func Routes() *web.Route { m.Use(context.ToggleAPI(&context.ToggleOptions{ SignInRequired: setting.Service.RequireSignInView, })) - + reqRepoCodeReader := context.RequireRepoReader(models.UnitTypeCode) m.Group("", func() { // Miscellaneous if setting.API.EnableSwagger { @@ -757,8 +757,8 @@ func Routes() *web.Route { m.Get("/files", context.RepoRef(), repo.GetPullFiles) m.Get("/issues", context.RepoRef(), repo.GetPullIssues) }) - // m.Get("/compare/*", context.RepoAssignment(), repo.MustBeNotEmpty, reqRepoCodeReader, - // repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.CompareDiff) + m.Get("/compare/*", repo.MustBeNotEmpty, reqRepoCodeReader, + repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.CompareDiff) // m.Get("/src/commit/*", context.RepoRefByType(context.RepoRefCommit), repo.GetFileContents) m.Get("/src/commit/*", context.RepoRefByType(context.RepoRefCommit), repo.GetFileContents) //end by coder