Explorar el Código

Merge branch 'main' into secrets

pull/30656/head
Giteabot hace 1 mes
padre
commit
426412e10a
No account linked to committer's email address
Se han modificado 2 ficheros con 7 adiciones y 1 borrados
  1. 6
    0
      routers/init.go
  2. 1
    1
      routers/web/web.go

+ 6
- 0
routers/init.go Ver fichero



import ( import (
"context" "context"
"net/http"
"reflect" "reflect"
"runtime" "runtime"


"code.gitea.io/gitea/modules/templates" "code.gitea.io/gitea/modules/templates"
"code.gitea.io/gitea/modules/translation" "code.gitea.io/gitea/modules/translation"
"code.gitea.io/gitea/modules/web" "code.gitea.io/gitea/modules/web"
"code.gitea.io/gitea/modules/web/routing"
actions_router "code.gitea.io/gitea/routers/api/actions" actions_router "code.gitea.io/gitea/routers/api/actions"
packages_router "code.gitea.io/gitea/routers/api/packages" packages_router "code.gitea.io/gitea/routers/api/packages"
apiv1 "code.gitea.io/gitea/routers/api/v1" apiv1 "code.gitea.io/gitea/routers/api/v1"
r.Mount(prefix, actions_router.ArtifactsV4Routes(prefix)) r.Mount(prefix, actions_router.ArtifactsV4Routes(prefix))
} }


r.NotFound(func(w http.ResponseWriter, req *http.Request) {
routing.UpdateFuncInfo(req.Context(), routing.GetFuncInfo(http.NotFound, "GlobalNotFound"))
http.NotFound(w, req)
})
return r return r
} }

+ 1
- 1
routers/web/web.go Ver fichero



m.NotFound(func(w http.ResponseWriter, req *http.Request) { m.NotFound(func(w http.ResponseWriter, req *http.Request) {
ctx := context.GetWebContext(req) ctx := context.GetWebContext(req)
routing.UpdateFuncInfo(ctx, routing.GetFuncInfo(ctx.NotFound, "GlobalNotFound"))
routing.UpdateFuncInfo(ctx, routing.GetFuncInfo(ctx.NotFound, "WebNotFound"))
ctx.NotFound("", nil) ctx.NotFound("", nil)
}) })
} }

Cargando…
Cancelar
Guardar