summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2016-06-09 11:45:43 +0200
committerAzul <azul@riseup.net>2016-06-09 11:45:46 +0200
commit25e80931939fe31b4a451281f0772f085acc7f9f (patch)
treecfc5a3c4009b40569badcc5bf9019a420cf5f02d /lib
parentb68b025a6d39516a6b4d04dd7c1786df50466d2c (diff)
refactor: inline method get_key_from_uid
well kind of since we were yielding this is more inlining the block and renaming the method
Diffstat (limited to 'lib')
-rw-r--r--lib/nickserver/server.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/nickserver/server.rb b/lib/nickserver/server.rb
index b528e4b..82fb376 100644
--- a/lib/nickserver/server.rb
+++ b/lib/nickserver/server.rb
@@ -75,12 +75,6 @@ module Nickserver
end
end
- def send_key(uid)
- get_key_from_uid(uid) do |key|
- send_response content: format_response(address: uid, openpgp: key)
- end
- end
-
def get_uid_from_request
if @http_query_string
params = CGI.parse(@http_query_string)
@@ -94,7 +88,7 @@ module Nickserver
end
end
- def get_key_from_uid(uid)
+ def send_key(uid)
if local_address?(uid)
@source = Nickserver::CouchDB::Source.new(adapter)
@source.query(uid) do |response|
@@ -103,7 +97,7 @@ module Nickserver
else
@fetcher = Nickserver::Hkp::FetchKey.new
@fetcher.get(uid).callback {|key|
- yield key
+ send_response content: format_response(address: uid, openpgp: key)
}.errback {|status, msg|
if status == 404
send_not_found