diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-10-17 23:45:00 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-10-17 23:45:00 +0200 |
commit | bb7ff8eb17695efcad62db4ccbce3d3678838448 (patch) | |
tree | 71d02e273c1ba67ec10af43b0309730fd5810edf /config | |
parent | bebfceb1df03e8afa10af5aead8e657654a14f01 (diff) | |
parent | d12c38e179fe0d2b14136cb9aaec052ac4244250 (diff) | |
download | gitlab-ce-bb7ff8eb17695efcad62db4ccbce3d3678838448.tar.gz |
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into 22191-delete-dynamic-envs-mr
Diffstat (limited to 'config')
-rw-r--r-- | config/routes/user.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/config/routes/user.rb b/config/routes/user.rb index dfb5d2a2ba4..0a9c924863d 100644 --- a/config/routes/user.rb +++ b/config/routes/user.rb @@ -1,8 +1,5 @@ require 'constraints/user_url_constrainer' -get '/u/:username', to: redirect('/%{username}'), - constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ } - devise_for :users, controllers: { omniauth_callbacks: :omniauth_callbacks, registrations: :registrations, passwords: :passwords, @@ -23,7 +20,7 @@ constraints(UserUrlConstrainer.new) do end end -scope(path: 'u/:username', +scope(path: 'users/:username', as: :user, constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ }, controller: :users) do @@ -36,3 +33,12 @@ scope(path: 'u/:username', get :exists get '/', to: redirect('/%{username}') end + +# Compatibility with old routing +# TODO (dzaporozhets): remove in 10.0 +get '/u/:username', to: redirect('/%{username}'), constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ } +# TODO (dzaporozhets): remove in 9.0 +get '/u/:username/groups', to: redirect('/users/%{username}/groups'), constraints: { username: /[a-zA-Z.0-9_\-]+/ } +get '/u/:username/projects', to: redirect('/users/%{username}/projects'), constraints: { username: /[a-zA-Z.0-9_\-]+/ } +get '/u/:username/snippets', to: redirect('/users/%{username}/snippets'), constraints: { username: /[a-zA-Z.0-9_\-]+/ } +get '/u/:username/contributed', to: redirect('/users/%{username}/contributed'), constraints: { username: /[a-zA-Z.0-9_\-]+/ } |