diff options
author | Stan Hu <stanhu@gmail.com> | 2017-10-25 21:15:35 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-10-28 00:32:38 +0300 |
commit | d6cd7006aef0199fd346ead55bf094afcf696d40 (patch) | |
tree | 825a51e7d0302023093236801cc5cb6a4c35ce4a /config | |
parent | dfd6c3f824ada5558546b809fd32468325788b94 (diff) |
Fix broken Members link when relative URL root paths are used
Navigating to the "Members" section of a project would omit the
relative URL root path. Fix the redirection and eliminate the
need for a redirection in the first place.
Fix other redirections failing to work with relative roots
Diffstat (limited to 'config')
-rw-r--r-- | config/routes/ci.rb | 2 | ||||
-rw-r--r-- | config/routes/project.rb | 2 | ||||
-rw-r--r-- | config/routes/snippets.rb | 2 | ||||
-rw-r--r-- | config/routes/user.rb | 12 |
4 files changed, 9 insertions, 9 deletions
diff --git a/config/routes/ci.rb b/config/routes/ci.rb index cbd4c2db852..60c1724bc05 100644 --- a/config/routes/ci.rb +++ b/config/routes/ci.rb @@ -1,5 +1,5 @@ namespace :ci do resource :lint, only: [:show, :create] - root to: redirect('/') + root to: redirect('') end diff --git a/config/routes/project.rb b/config/routes/project.rb index d05fe11f233..9f553085d50 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -393,7 +393,7 @@ constraints(ProjectUrlConstrainer.new) do end end namespace :settings do - get :members, to: redirect('/%{namespace_id}/%{project_id}/project_members') + get :members, to: redirect("%{namespace_id}/%{project_id}/project_members") resource :ci_cd, only: [:show], controller: 'ci_cd' resource :integrations, only: [:show] resource :repository, only: [:show], controller: :repository diff --git a/config/routes/snippets.rb b/config/routes/snippets.rb index 0a4ebac3ca3..81bc890d86b 100644 --- a/config/routes/snippets.rb +++ b/config/routes/snippets.rb @@ -17,5 +17,5 @@ resources :snippets, concerns: :awardable do end end -get '/s/:username', to: redirect('/u/%{username}/snippets'), +get '/s/:username', to: redirect('u/%{username}/snippets'), constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ } diff --git a/config/routes/user.rb b/config/routes/user.rb index e682dcd6663..733a3f6ce9a 100644 --- a/config/routes/user.rb +++ b/config/routes/user.rb @@ -22,17 +22,17 @@ scope(constraints: { username: Gitlab::PathRegex.root_namespace_route_regex }) d get :contributed, as: :contributed_projects get :snippets get :exists - get '/', to: redirect('/%{username}'), as: nil + get '/', to: redirect('%{username}'), as: nil end # Compatibility with old routing # TODO (dzaporozhets): remove in 10.0 - get '/u/:username', to: redirect('/%{username}') + get '/u/:username', to: redirect('%{username}') # TODO (dzaporozhets): remove in 9.0 - get '/u/:username/groups', to: redirect('/users/%{username}/groups') - get '/u/:username/projects', to: redirect('/users/%{username}/projects') - get '/u/:username/snippets', to: redirect('/users/%{username}/snippets') - get '/u/:username/contributed', to: redirect('/users/%{username}/contributed') + get '/u/:username/groups', to: redirect('users/%{username}/groups') + get '/u/:username/projects', to: redirect('users/%{username}/projects') + get '/u/:username/snippets', to: redirect('users/%{username}/snippets') + get '/u/:username/contributed', to: redirect('users/%{username}/contributed') end constraints(UserUrlConstrainer.new) do |