+6
-1
appview/state/router.go
+6
-1
appview/state/router.go
···
75
75
r.Get("/", s.Profile)
76
76
r.Get("/feed.atom", s.AtomFeedPage)
77
77
78
+
// redirect /@handle/repo.git -> /@handle/repo
79
+
r.Get("/{repo}.git", func(w http.ResponseWriter, r *http.Request) {
80
+
nonDotGitPath := strings.TrimSuffix(r.URL.Path, ".git")
81
+
http.Redirect(w, r, nonDotGitPath, http.StatusMovedPermanently)
82
+
})
83
+
78
84
r.With(mw.ResolveRepo()).Route("/{repo}", func(r chi.Router) {
79
85
r.Use(mw.GoImport())
80
-
81
86
r.Mount("/", s.RepoRouter(mw))
82
87
r.Mount("/issues", s.IssuesRouter(mw))
83
88
r.Mount("/pulls", s.PullsRouter(mw))