diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-04-27 14:06:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-27 02:06:45 -0400 |
commit | 92fd3fc4fd369b6a8c0a022a32a80dec2340223a (patch) | |
tree | c721a4988b5ec250a029b19274ef1c2dc4c19faa /routers/init.go | |
parent | 1c875ef5bef206b8214c33437f65af929967df46 (diff) | |
download | gitea-92fd3fc4fd369b6a8c0a022a32a80dec2340223a.tar.gz gitea-92fd3fc4fd369b6a8c0a022a32a80dec2340223a.zip |
Refactor "route" related code, fix Safari cookie bug (#24330)
Fix #24176
Clean some misuses of route package, clean some legacy FIXMEs
---------
Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'routers/init.go')
-rw-r--r-- | routers/init.go | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/routers/init.go b/routers/init.go index af768abbf4..2c26bb5b07 100644 --- a/routers/init.go +++ b/routers/init.go @@ -177,20 +177,15 @@ func GlobalInitInstalled(ctx context.Context) { func NormalRoutes(ctx context.Context) *web.Route { ctx, _ = templates.HTMLRenderer(ctx) r := web.NewRoute() - for _, middle := range common.Middlewares() { - r.Use(middle) - } + r.Use(common.ProtocolMiddlewares()...) r.Mount("/", web_routers.Routes(ctx)) r.Mount("/api/v1", apiv1.Routes(ctx)) r.Mount("/api/internal", private.Routes()) if setting.Packages.Enabled { - // Add endpoints to match common package manager APIs - // This implements package support for most package managers r.Mount("/api/packages", packages_router.CommonRoutes(ctx)) - // This implements the OCI API (Note this is not preceded by /api but is instead /v2) r.Mount("/v2", packages_router.ContainerRoutes(ctx)) } |