Skip to content

Commit

Permalink
Send 404 on /{org}.gpg (go-gitea#18959)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gusted authored Mar 2, 2022
1 parent 1f45d1e commit a90041d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion routers/web/org/home.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package org

import (
"net/http"
"strings"

"code.gitea.io/gitea/models"
"code.gitea.io/gitea/models/db"
Expand All @@ -23,7 +24,14 @@ const (

// Home show organization home page
func Home(ctx *context.Context) {
ctx.SetParams(":org", ctx.Params(":username"))
uname := ctx.Params(":username")

if strings.HasSuffix(uname, ".keys") || strings.HasSuffix(uname, ".gpg") {
ctx.NotFound("", nil)
return
}

ctx.SetParams(":org", uname)
context.HandleOrgAssignment(ctx)
if ctx.Written() {
return
Expand Down

0 comments on commit a90041d

Please sign in to comment.