Skip to content

Commit 747d481

Browse files
GustedStelios Malathouras
Gusted
authored and
Stelios Malathouras
committed
Send 404 on /{org}.gpg (go-gitea#18959)
1 parent e772d12 commit 747d481

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

routers/web/org/home.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package org
66

77
import (
88
"net/http"
9+
"strings"
910

1011
"code.gitea.io/gitea/models"
1112
"code.gitea.io/gitea/models/db"
@@ -23,7 +24,14 @@ const (
2324

2425
// Home show organization home page
2526
func Home(ctx *context.Context) {
26-
ctx.SetParams(":org", ctx.Params(":username"))
27+
uname := ctx.Params(":username")
28+
29+
if strings.HasSuffix(uname, ".keys") || strings.HasSuffix(uname, ".gpg") {
30+
ctx.NotFound("", nil)
31+
return
32+
}
33+
34+
ctx.SetParams(":org", uname)
2735
context.HandleOrgAssignment(ctx)
2836
if ctx.Written() {
2937
return

0 commit comments

Comments
 (0)