summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-10-08 09:25:06 -0700
committerStan Hu <stanhu@gmail.com>2016-10-08 09:58:25 -0700
commite72f2cfcb23c80f3bf634cc339ed2a468d4e9fce (patch)
tree392cc0819ca8cd13f9072d2e3187eb84837636e6 /config
parented2fe98412e072214c4579eb9bfdae0e5e440f72 (diff)
downloadgitlab-ce-e72f2cfcb23c80f3bf634cc339ed2a468d4e9fce.tar.gz
Fix missing constraints causing route failures when usernames with periods are usedsh-add-user-constraints
Closes #23131
Diffstat (limited to 'config')
-rw-r--r--config/routes/user.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/config/routes/user.rb b/config/routes/user.rb
index c287039ba26..54bbcb18f6a 100644
--- a/config/routes/user.rb
+++ b/config/routes/user.rb
@@ -15,7 +15,10 @@ devise_scope :user do
end
constraints(UserUrlConstrainer.new) do
- scope(path: ':username', as: :user, controller: :users) do
+ scope(path: ':username',
+ as: :user,
+ constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ },
+ controller: :users) do
get '/', action: :show
end
end