File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ package routers
5
5
6
6
import (
7
7
"context"
8
+ "net/http"
8
9
"reflect"
9
10
"runtime"
10
11
@@ -25,6 +26,7 @@ import (
25
26
"code.gitea.io/gitea/modules/templates"
26
27
"code.gitea.io/gitea/modules/translation"
27
28
"code.gitea.io/gitea/modules/web"
29
+ "code.gitea.io/gitea/modules/web/routing"
28
30
actions_router "code.gitea.io/gitea/routers/api/actions"
29
31
packages_router "code.gitea.io/gitea/routers/api/packages"
30
32
apiv1 "code.gitea.io/gitea/routers/api/v1"
@@ -202,5 +204,9 @@ func NormalRoutes() *web.Route {
202
204
r .Mount (prefix , actions_router .ArtifactsV4Routes (prefix ))
203
205
}
204
206
207
+ r .NotFound (func (w http.ResponseWriter , req * http.Request ) {
208
+ routing .UpdateFuncInfo (req .Context (), routing .GetFuncInfo (http .NotFound , "GlobalNotFound" ))
209
+ http .NotFound (w , req )
210
+ })
205
211
return r
206
212
}
Original file line number Diff line number Diff line change @@ -1612,7 +1612,7 @@ func registerRoutes(m *web.Route) {
1612
1612
1613
1613
m .NotFound (func (w http.ResponseWriter , req * http.Request ) {
1614
1614
ctx := context .GetWebContext (req )
1615
- routing .UpdateFuncInfo (ctx , routing .GetFuncInfo (ctx .NotFound , "GlobalNotFound " ))
1615
+ routing .UpdateFuncInfo (ctx , routing .GetFuncInfo (ctx .NotFound , "WebNotFound " ))
1616
1616
ctx .NotFound ("" , nil )
1617
1617
})
1618
1618
}
You can’t perform that action at this time.
0 commit comments