mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-26 06:16:56 +09:00
refactor: username sub route (#39967)
Remove the workaround for chi router, do as much as possible in middlewares --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
13 files changed
+103
-117
No files matched your search
@@ -5,7 +5,6 @@ package org
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/models/organization"
|
||||
@@ -25,14 +24,7 @@ const tplOrgHome templates.TplName = "org/home"
|
||||
|
||||
// Home show organization home page
|
||||
func Home(ctx *context.Context) {
|
||||
uname := ctx.PathParam("username")
|
||||
|
||||
if strings.HasSuffix(uname, ".keys") || strings.HasSuffix(uname, ".gpg") {
|
||||
ctx.NotFound(nil)
|
||||
return
|
||||
}
|
||||
|
||||
ctx.SetPathParam("org", uname)
|
||||
ctx.SetPathParam("org", ctx.PathParam("username"))
|
||||
context.OrgAssignment(context.OrgAssignmentOptions{})(ctx)
|
||||
if ctx.Written() {
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user