Skip to content

Commit

Permalink
Send 404 on /{org}.gpg (#18959) (#18962)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gusted authored Mar 2, 2022
1 parent 36e96e3 commit 52517e3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions 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 Expand Up @@ -109,7 +117,7 @@ func Home(ctx *context.Context) {
return
}

var opts = &models.FindOrgMembersOpts{
opts := &models.FindOrgMembersOpts{
OrgID: org.ID,
PublicOnly: true,
ListOptions: db.ListOptions{Page: 1, PageSize: 25},
Expand Down

0 comments on commit 52517e3

Please sign in to comment.