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.
tokarchuk/v1.17
Gusted 3 years ago committed by GitHub
parent ba5f2acb9c
commit 43332a483f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 26
      integrations/user_test.go
  2. 10
      models/user/user.go

@ -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")

@ -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",
} }

Loading…
Cancel
Save