diff options
-rw-r--r-- | app/controllers/application_controller.rb | 4 | ||||
-rw-r--r-- | config/routes.rb | 2 |
2 files changed, 6 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 diff --git a/config/routes.rb b/config/routes.rb index 83c3a42c19f..659ea51bc75 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -88,4 +88,6 @@ Rails.application.routes.draw do get ':username.keys' => 'profiles/keys#get_keys', constraints: { username: /.*/ } root to: "root#index" + + get '*unmatched_route', to: 'application#not_found' end |