mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Send 404 on /{org}.gpg (#18959)
				
					
				
			This commit is contained in:
		@@ -6,6 +6,7 @@ package org
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"net/http"
 | 
						"net/http"
 | 
				
			||||||
 | 
						"strings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"code.gitea.io/gitea/models"
 | 
						"code.gitea.io/gitea/models"
 | 
				
			||||||
	"code.gitea.io/gitea/models/db"
 | 
						"code.gitea.io/gitea/models/db"
 | 
				
			||||||
@@ -23,7 +24,14 @@ const (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// Home show organization home page
 | 
					// Home show organization home page
 | 
				
			||||||
func Home(ctx *context.Context) {
 | 
					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)
 | 
						context.HandleOrgAssignment(ctx)
 | 
				
			||||||
	if ctx.Written() {
 | 
						if ctx.Written() {
 | 
				
			||||||
		return
 | 
							return
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user