summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-10-15 14:48:16 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-10-15 14:48:16 +0000
commit5cf10240f9d8736923c57ff35c5c4acab7de37dc (patch)
treead90d0332f35f19e00158e0ec2bb8a944e4f67fe /app
parent8ef91a0ac78a0c95b616b54c2042e64fd0711f23 (diff)
parentb0622d657893b156ac0c265f397efeb28d5b0b4c (diff)
downloadgitlab-ce-5cf10240f9d8736923c57ff35c5c4acab7de37dc.tar.gz
Merge branch 'dz-handle-unmatched-routes' into 'master'
Handle unmatched routing with not_found method ## What does this MR do? Handle all unmatched routes with 404 method ## Why was this MR needed? We need this to prevent routing error when user access URL like /123 when there is no resource located under such name. ## What are the relevant issue numbers? Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/23378 and https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6733. See merge request !6905
Diffstat (limited to 'app')
-rw-r--r--app/controllers/application_controller.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index b3455e04c29..705824502eb 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -45,6 +45,10 @@ class ApplicationController < ActionController::Base
redirect_to request.referer.present? ? :back : default, options
end
+ def not_found
+ render_404
+ end
+
protected
# This filter handles both private tokens and personal access tokens