mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	Fixes a wrong 302 redirect to the login page, see https://github.com/go-gitea/gitea/issues/11989. Also made it so the reserved username list is extended with those known entries so we avoid code duplication.
This commit is contained in:
		| @@ -29,6 +29,7 @@ import ( | ||||
| 	"code.gitea.io/gitea/modules/generate" | ||||
| 	"code.gitea.io/gitea/modules/git" | ||||
| 	"code.gitea.io/gitea/modules/log" | ||||
| 	"code.gitea.io/gitea/modules/public" | ||||
| 	"code.gitea.io/gitea/modules/setting" | ||||
| 	"code.gitea.io/gitea/modules/structs" | ||||
| 	api "code.gitea.io/gitea/modules/structs" | ||||
| @@ -878,7 +879,7 @@ func (u *User) IsGhost() bool { | ||||
| } | ||||
|  | ||||
| var ( | ||||
| 	reservedUsernames = []string{ | ||||
| 	reservedUsernames = append([]string{ | ||||
| 		".", | ||||
| 		"..", | ||||
| 		".well-known", | ||||
| @@ -888,17 +889,13 @@ var ( | ||||
| 		"attachments", | ||||
| 		"avatars", | ||||
| 		"commits", | ||||
| 		"css", | ||||
| 		"debug", | ||||
| 		"error", | ||||
| 		"explore", | ||||
| 		"fomantic", | ||||
| 		"ghost", | ||||
| 		"help", | ||||
| 		"img", | ||||
| 		"install", | ||||
| 		"issues", | ||||
| 		"js", | ||||
| 		"less", | ||||
| 		"login", | ||||
| 		"manifest.json", | ||||
| @@ -916,8 +913,8 @@ var ( | ||||
| 		"stars", | ||||
| 		"template", | ||||
| 		"user", | ||||
| 		"vendor", | ||||
| 	} | ||||
| 	}, public.KnownPublicEntries...) | ||||
|  | ||||
| 	reservedUserPatterns = []string{"*.keys", "*.gpg"} | ||||
| ) | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user