summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/keys_controller.rb7
-rw-r--r--app/controllers/pages_controller.rb2
2 files changed, 6 insertions, 3 deletions
diff --git a/app/controllers/keys_controller.rb b/app/controllers/keys_controller.rb
index fb28901..dbb5d96 100644
--- a/app/controllers/keys_controller.rb
+++ b/app/controllers/keys_controller.rb
@@ -3,15 +3,16 @@ class KeysController < ApplicationController
#
# Render the user's key as plain text, without a layout.
#
- # We will show blank page if user doesn't have key (which shouldn't generally occur)
- # and a 404 error if user doesn't exist
+ # 404 error if user doesn't exist
+ #
+ # blank result if user doesn't have key (which shouldn't generally occur)
#
def show
user = User.find_by_login(params[:login])
if user
render text: user.public_key, content_type: 'text/text'
else
- raise ActionController::RoutingError.new('Not Found')
+ head 404
end
end
diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb
index b9c601a..4508450 100644
--- a/app/controllers/pages_controller.rb
+++ b/app/controllers/pages_controller.rb
@@ -9,6 +9,8 @@ class PagesController < ApplicationController
def show
@show_navigation = false
render page_name
+ rescue ActionView::MissingTemplate
+ raise ActionController::RoutingError.new('Not Found')
end
private