Update reserved usernames list (#18438)

Adding additional usernames which are already routes, remove unused ones.
In future, avoid reserving names as much as possible, use `/-/` in path instead.
This commit is contained in:
Gusted 2022-03-31 06:02:13 +02:00 committed by GitHub
parent ba5f2acb9c
commit 43332a483f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 10 deletions

View file

@ -75,23 +75,41 @@ func TestRenameReservedUsername(t *testing.T) {
defer prepareTestEnv(t)() defer prepareTestEnv(t)()
reservedUsernames := []string{ reservedUsernames := []string{
".",
"..",
".well-known",
"admin", "admin",
"api", "api",
"assets",
"attachments", "attachments",
"avatar",
"avatars", "avatars",
"captcha",
"commits",
"debug",
"error",
"explore", "explore",
"help", "favicon.ico",
"install", "ghost",
"issues", "issues",
"login", "login",
"manifest.json",
"metrics", "metrics",
"milestones",
"new",
"notifications", "notifications",
"org", "org",
"pulls", "pulls",
"raw",
"repo", "repo",
"template", "repo-avatars",
"user", "robots.txt",
"search", "search",
"serviceworker.js",
"ssh_info",
"swagger.v1.json",
"user",
"v2",
} }
session := loginUser(t, "user2") session := loginUser(t, "user2")

View file

@ -576,6 +576,7 @@ var (
"api", "api",
"assets", "assets",
"attachments", "attachments",
"avatar",
"avatars", "avatars",
"captcha", "captcha",
"commits", "commits",
@ -584,10 +585,7 @@ var (
"explore", "explore",
"favicon.ico", "favicon.ico",
"ghost", "ghost",
"help",
"install",
"issues", "issues",
"less",
"login", "login",
"manifest.json", "manifest.json",
"metrics", "metrics",
@ -595,15 +593,15 @@ var (
"new", "new",
"notifications", "notifications",
"org", "org",
"plugins",
"pulls", "pulls",
"raw", "raw",
"repo", "repo",
"repo-avatars",
"robots.txt", "robots.txt",
"search", "search",
"serviceworker.js", "serviceworker.js",
"stars", "ssh_info",
"template", "swagger.v1.json",
"user", "user",
"v2", "v2",
} }