aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--routers/routes/chi.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/routers/routes/chi.go b/routers/routes/chi.go
index 5ff7a728ff..00689441b7 100644
--- a/routers/routes/chi.go
+++ b/routers/routes/chi.go
@@ -230,6 +230,12 @@ func RegisterInstallRoute(c chi.Router) {
m := NewMacaron()
RegisterMacaronInstallRoute(m)
+ // We need at least one handler in chi so that it does not drop
+ // our middleware: https://github.com/go-gitea/gitea/issues/13725#issuecomment-735244395
+ c.Get("/", func(w http.ResponseWriter, req *http.Request) {
+ m.ServeHTTP(w, req)
+ })
+
c.NotFound(func(w http.ResponseWriter, req *http.Request) {
m.ServeHTTP(w, req)
})