summaryrefslogtreecommitdiff
path: root/lib/api/api.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-10-11 06:58:05 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-10-11 06:58:05 +0000
commit73adae0f62a3d6048abbee9d076e077185370325 (patch)
tree8f5e5bcbbd76aa356e50b44d838cb61cac9d89f4 /lib/api/api.rb
parent6f441ae1a10a00007fcb361626f826321b511d90 (diff)
parentc69b81839430500de49d089df2049e778c8b7ef8 (diff)
downloadgitlab-ce-73adae0f62a3d6048abbee9d076e077185370325.tar.gz
Merge branch 'dz-cleanup-routing' into 'master'
Remove NamespacesController * removes unnecessary NamespacesController. The main purpose of this controller was redirect to group or user page when URL like https://gitlab.com/gitlab-org was used. Now this functionality is handled by constrainers (like this https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/routes/user.rb#L17-21) and take user to correct controller right from the start. * serve non existing API routes like `/api/v3/whatever` with Grape instead of Rails. Before this change wrong API url was served by rails with not obvious 404, 405 & 500 errors See merge request !6733
Diffstat (limited to 'lib/api/api.rb')
-rw-r--r--lib/api/api.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/api/api.rb b/lib/api/api.rb
index 0bbf73a1b63..99722a0a65c 100644
--- a/lib/api/api.rb
+++ b/lib/api/api.rb
@@ -73,5 +73,9 @@ module API
mount ::API::Triggers
mount ::API::Users
mount ::API::Variables
+
+ route :any, '*path' do
+ error!('404 Not Found', 404)
+ end
end
end