Skip to content

Commit

Permalink
Update reserved usernames list (#18438)
Browse files Browse the repository at this point in the history
Adding additional usernames which are already routes, remove unused ones.
In future, avoid reserving names as much as possible, use `/-/` in path instead.
  • Loading branch information
Gusted committed Mar 31, 2022
1 parent ba5f2ac commit 43332a4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
26 changes: 22 additions & 4 deletions integrations/user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
10 changes: 4 additions & 6 deletions models/user/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ var (
"api",
"assets",
"attachments",
"avatar",
"avatars",
"captcha",
"commits",
Expand All @@ -584,26 +585,23 @@ var (
"explore",
"favicon.ico",
"ghost",
"help",
"install",
"issues",
"less",
"login",
"manifest.json",
"metrics",
"milestones",
"new",
"notifications",
"org",
"plugins",
"pulls",
"raw",
"repo",
"repo-avatars",
"robots.txt",
"search",
"serviceworker.js",
"stars",
"template",
"ssh_info",
"swagger.v1.json",
"user",
"v2",
}
Expand Down

0 comments on commit 43332a4

Please sign in to comment.