mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-03 13:20:28 +00:00
[TESTS] testMiddlewareHook, dependency injection in integration tests
(cherry picked from commit6623630d10
) (cherry picked from commitd30b9dc5b4
) (cherry picked from commit8e790a65ba
) (cherry picked from commit9d98ba7e5c
) (cherry picked from commit07fc55a3a7
) (cherry picked from commitf9d054d17f
)
This commit is contained in:
parent
61a3cf77df
commit
c7dc1e1c7f
6 changed files with 28 additions and 19 deletions
|
@ -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
|
||||
|
@ -159,6 +159,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...)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue