summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/leap_web/version.rb2
-rw-r--r--users/app/controllers/keys_controller.rb16
2 files changed, 12 insertions, 6 deletions
diff --git a/lib/leap_web/version.rb b/lib/leap_web/version.rb
index f6f99ae..983e3ad 100644
--- a/lib/leap_web/version.rb
+++ b/lib/leap_web/version.rb
@@ -1,3 +1,3 @@
module LeapWeb
- VERSION = "0.2.8.rc" unless defined?(LeapWeb::VERSION)
+ VERSION = "0.2.8" unless defined?(LeapWeb::VERSION)
end
diff --git a/users/app/controllers/keys_controller.rb b/users/app/controllers/keys_controller.rb
index 949f2c0..fb28901 100644
--- a/users/app/controllers/keys_controller.rb
+++ b/users/app/controllers/keys_controller.rb
@@ -1,12 +1,18 @@
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
+ #
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 (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'))
-
+ if user
+ render text: user.public_key, content_type: 'text/text'
+ else
+ raise ActionController::RoutingError.new('Not Found')
+ end
end
end