summaryrefslogtreecommitdiff
path: root/app/controllers/keys_controller.rb
diff options
context:
space:
mode:
authorazul <azul@riseup.net>2017-03-21 09:37:29 +0000
committerazul <azul@riseup.net>2017-03-21 09:37:29 +0000
commit987d1bf7c87f7ea3d17c40015b2ec92a8a0b4ecc (patch)
treef2eae1401adccf77cb244d0b642f7ee66f3d1a46 /app/controllers/keys_controller.rb
parent3fd52ccca46310c32ecfabb69b41630cb41dca7e (diff)
parent47c945b101a01bf438024ede594b3a039c4eca66 (diff)
Merge branch 'bugfix/404-for-keys-on-text-request' into 'master'
fix: 404 on key request with non html content-type Closes #8 See merge request !20
Diffstat (limited to 'app/controllers/keys_controller.rb')
-rw-r--r--app/controllers/keys_controller.rb7
1 files changed, 4 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