aboutsummaryrefslogtreecommitdiff
path: root/cmd/web.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/web.go')
-rw-r--r--cmd/web.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/web.go b/cmd/web.go
index 73e4ee49..b6aa2dd7 100644
--- a/cmd/web.go
+++ b/cmd/web.go
@@ -623,11 +623,14 @@ func runWeb(ctx *cli.Context) error {
m.Group("/:reponame", func() {
m.Head("/tasks/trigger", repo.TriggerTask)
})
- // Use the regexp to match the repository name validation
+ // Use the regexp to match the repository name
+ // Duplicated routes to enable different ways of accessing same set of URLs,
+ // e.g. with or without ".git" suffix.
m.Group("/:reponame([\\d\\w-_\\.]+\\.git$)", func() {
m.Get("", ignSignIn, context.RepoAssignment(true), context.RepoRef(), repo.Home)
m.Route("/*", "GET,POST", ignSignInAndCsrf, repo.HTTPContexter(), repo.HTTP)
})
+ m.Route("/:reponame/*", "GET,POST", ignSignInAndCsrf, repo.HTTPContexter(), repo.HTTP)
})
// ***** END: Repository *****