1
0
Fork 0
forked from forgejo/forgejo

[TESTS] testMiddlewareHook, dependency injection in integration tests

(cherry picked from commit 6623630d10)
(cherry picked from commit d30b9dc5b4)
(cherry picked from commit 8e790a65ba)
This commit is contained in:
Earl Warren 2023-06-05 11:04:47 +02:00
parent ef9494ddef
commit 9d98ba7e5c
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
6 changed files with 28 additions and 19 deletions

View file

@ -104,7 +104,7 @@ func ctxDataSet(args ...any) func(ctx *context.Context) {
}
// Routes returns all web routes
func Routes() *web.Route {
func Routes(middlewares ...any) *web.Route {
routes := web.NewRoute()
routes.Head("/", misc.DummyOK) // for health check - doesn't need to be passed through gzip handler
@ -162,6 +162,7 @@ func Routes() *web.Route {
mid = append(mid, user.GetNotificationCount)
mid = append(mid, repo.GetActiveStopwatch)
mid = append(mid, goGet)
mid = append(mid, middlewares...)
others := web.NewRoute()
others.Use(mid...)