···
http.Redirect(w, r, "/"+redirectPath, http.StatusFound)
standardRouter.ServeHTTP(w, r)
···
r.Get("/feed.atom", s.AtomFeedPage)
-
// redirect /@handle/repo.git -> /@handle/repo
-
r.Get("/{repo}.git", func(w http.ResponseWriter, r *http.Request) {
-
nonDotGitPath := strings.TrimSuffix(r.URL.Path, ".git")
-
http.Redirect(w, r, nonDotGitPath, http.StatusMovedPermanently)
r.With(mw.ResolveRepo()).Route("/{repo}", func(r chi.Router) {
r.Mount("/", s.RepoRouter(mw))
···
http.Redirect(w, r, "/"+redirectPath, http.StatusFound)
standardRouter.ServeHTTP(w, r)
···
r.Get("/feed.atom", s.AtomFeedPage)
r.With(mw.ResolveRepo()).Route("/{repo}", func(r chi.Router) {
r.Mount("/", s.RepoRouter(mw))