Browse Source

Fix regex on route file (#3851)

pull/3755/merge
Thibault Meyer 8 years ago committed by 无闻
parent
commit
93616fe776
  1. 6
      cmd/web.go

6
cmd/web.go

@ -586,12 +586,12 @@ func runWeb(ctx *cli.Context) error {
m.Get("/src/*", repo.Home) m.Get("/src/*", repo.Home)
m.Get("/raw/*", repo.SingleDownload) m.Get("/raw/*", repo.SingleDownload)
m.Get("/commits/*", repo.RefCommits) m.Get("/commits/*", repo.RefCommits)
m.Get("/commit/:sha([a-z0-9]{7,40})$", repo.Diff) m.Get("/commit/:sha([a-f0-9]{7,40})$", repo.Diff)
m.Get("/forks", repo.Forks) m.Get("/forks", repo.Forks)
}, context.RepoRef()) }, context.RepoRef())
m.Get("/commit/:sha([a-z0-9]{7,40})\\.:ext(patch|diff)", repo.RawDiff) m.Get("/commit/:sha([a-f0-9]{7,40})\\.:ext(patch|diff)", repo.RawDiff)
m.Get("/compare/:before([a-z0-9]{7,40})\\.\\.\\.:after([a-z0-9]{7,40})", repo.CompareDiff) m.Get("/compare/:before([a-z0-9]{40})\\.\\.\\.:after([a-z0-9]{40})", repo.CompareDiff)
}, ignSignIn, context.RepoAssignment(), repo.MustBeNotBare) }, ignSignIn, context.RepoAssignment(), repo.MustBeNotBare)
m.Group("/:username/:reponame", func() { m.Group("/:username/:reponame", func() {
m.Get("/stars", repo.Stars) m.Get("/stars", repo.Stars)

Loading…
Cancel
Save