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)()
reservedUsernames := []string{
".",
"..",
".well-known",
"admin",
"api",
"assets",
"attachments",
"avatar",
"avatars",
"captcha",
"commits",
"debug",
"error",
"explore",
"help",
"install",
"favicon.ico",
"ghost",
"issues",
"login",
"manifest.json",
"metrics",
"milestones",
"new",
"notifications",
"org",
"pulls",
"raw",
"repo",
"template",
"user",
"repo-avatars",
"robots.txt",
"search",
"serviceworker.js",
"ssh_info",
"swagger.v1.json",
"user",
"v2",
}
session := loginUser(t, "user2")

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

Loading…
Cancel
Save