Skip to content

Commit 137dcbf

Browse files
authored
Merge pull request #47 from 0xbaadf00d/fix/3743-route-regexp-branchname
Fix SHA and compare regex on route file [Critical]
2 parents 42a744d + 1adde07 commit 137dcbf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cmd/web.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -585,12 +585,12 @@ func runWeb(ctx *cli.Context) error {
585585
m.Get("/src/*", repo.Home)
586586
m.Get("/raw/*", repo.SingleDownload)
587587
m.Get("/commits/*", repo.RefCommits)
588-
m.Get("/commit/:sha([a-z0-9]{7,40})$", repo.Diff)
588+
m.Get("/commit/:sha([a-f0-9]{7,40})$", repo.Diff)
589589
m.Get("/forks", repo.Forks)
590590
}, context.RepoRef())
591-
m.Get("/commit/:sha([a-z0-9]{7,40})\\.:ext(patch|diff)", repo.RawDiff)
591+
m.Get("/commit/:sha([a-f0-9]{7,40})\\.:ext(patch|diff)", repo.RawDiff)
592592

593-
m.Get("/compare/:before([a-z0-9]{7,40})\\.\\.\\.:after([a-z0-9]{7,40})", repo.CompareDiff)
593+
m.Get("/compare/:before([a-z0-9]{40})\\.\\.\\.:after([a-z0-9]{40})", repo.CompareDiff)
594594
}, ignSignIn, context.RepoAssignment(), repo.MustBeNotBare)
595595
m.Group("/:username/:reponame", func() {
596596
m.Get("/stars", repo.Stars)

0 commit comments

Comments
 (0)