summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2019-05-21 11:35:29 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2019-05-21 11:35:29 +0300
commit6d3f5a33419a6dd52d4f6378f674e28eb22ad323 (patch)
tree94fd7a9c57b924f7dced199763d6ae455cfc3af3 /config
parent70decdc2acb4da895bdd63bb15b46014045af661 (diff)
downloadgitlab-ce-6d3f5a33419a6dd52d4f6378f674e28eb22ad323.tar.gz
Add legacy routes for modified project path
For settings, branches and tags Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'config')
-rw-r--r--config/routes/project.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/config/routes/project.rb b/config/routes/project.rb
index f0f151c60ed..65e2d814c7c 100644
--- a/config/routes/project.rb
+++ b/config/routes/project.rb
@@ -496,4 +496,18 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end
end
end
+
+ # Legacy routes.
+ # Introduced in 12.0.
+ # Should be removed after 12.1
+ scope(path: '*namespace_id',
+ as: :namespace,
+ namespace_id: Gitlab::PathRegex.full_namespace_route_regex) do
+ scope(path: ':project_id',
+ constraints: { project_id: Gitlab::PathRegex.project_route_regex },
+ module: :projects,
+ as: :project) do
+ Gitlab::Routing.redirect_legacy_paths(self, :settings, :branches, :tags)
+ end
+ end
end