Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang committed Oct 10, 2024
1 parent c221767 commit f7cf41c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 55 deletions.
51 changes: 26 additions & 25 deletions models/user/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -565,37 +565,38 @@ var (
".",
"..",
".well-known",
"api",
"assets",
"attachments",
"avatar",
"avatars",

"api", // gitea api
"metrics", // prometheus metrics api
"v2", // container registry api

"assets", // static asset files
"attachments", // issue attachments

"avatar", // avatar by email hash
"avatars", // user avatars by file name
"repo-avatars",

"captcha",
"commits",
"debug",
"error",
"login", // oauth2 login
"org", // org create/manage, or "/org/{org}", BUT if an org is named as "invite" then it goes wrong
"user", // user login/activate/settings, etc
"repo", // repo create/migrate, etc

"explore",
"favicon.ico",
"ghost",
"issues",
"login",
"manifest.json",
"metrics",
"pulls",
"milestones",
"new",
"notifications",
"org",
"pulls",
"raw",
"repo",
"repo-avatars",
"robots.txt",
"search",
"serviceworker.js",
"ssh_info",

"favicon.ico",
"manifest.json", // web app manifests
"robots.txt", // search engine robots
"sitemap.xml", // search engine sitemap
"ssh_info", // agit info
"swagger.v1.json",
"user",
"v2",

"ghost", // reserved name for deleted users
"gitea-actions",
}

Expand Down
31 changes: 1 addition & 30 deletions tests/integration/user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,36 +98,7 @@ func TestRenameReservedUsername(t *testing.T) {
reservedUsernames := []string{
// ".", "..", ".well-known", // The names are not only reserved but also invalid
"api",
"assets",
"attachments",
"avatar",
"avatars",
"captcha",
"commits",
"debug",
"error",
"explore",
"favicon.ico",
"ghost",
"issues",
"login",
"manifest.json",
"metrics",
"milestones",
"new",
"notifications",
"org",
"pulls",
"raw",
"repo",
"repo-avatars",
"robots.txt",
"search",
"serviceworker.js",
"ssh_info",
"swagger.v1.json",
"user",
"v2",
"name.keys",
}

session := loginUser(t, "user2")
Expand Down

0 comments on commit f7cf41c

Please sign in to comment.