summaryrefslogtreecommitdiff
path: root/users/app/controllers/keys_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'users/app/controllers/keys_controller.rb')
-rw-r--r--users/app/controllers/keys_controller.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/users/app/controllers/keys_controller.rb b/users/app/controllers/keys_controller.rb
index 9a39fc4..949f2c0 100644
--- a/users/app/controllers/keys_controller.rb
+++ b/users/app/controllers/keys_controller.rb
@@ -3,8 +3,10 @@ class KeysController < ApplicationController
def show
user = User.find_by_login(params[:login])
# layout won't be included if we render text
- # we will show blank page if user doesn't have key or user doesn't exist
- render text: user ? user.public_key : ''
+ # 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
+ user ? (render text: user.public_key) : (raise ActionController::RoutingError.new('Not Found'))
+
end
end