Skip to content

Commit a90041d

Browse files
author
Gusted
authored
Send 404 on /{org}.gpg (#18959)
1 parent 1f45d1e commit a90041d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

routers/web/org/home.go

+9-1
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)