summaryrefslogtreecommitdiff
path: root/lib/nickserver/request_handlers
diff options
context:
space:
mode:
Diffstat (limited to 'lib/nickserver/request_handlers')
-rw-r--r--lib/nickserver/request_handlers/email_handler.rb9
-rw-r--r--lib/nickserver/request_handlers/fingerprint_handler.rb7
2 files changed, 14 insertions, 2 deletions
diff --git a/lib/nickserver/request_handlers/email_handler.rb b/lib/nickserver/request_handlers/email_handler.rb
index 3f7515d..b163b27 100644
--- a/lib/nickserver/request_handlers/email_handler.rb
+++ b/lib/nickserver/request_handlers/email_handler.rb
@@ -8,6 +8,13 @@ module Nickserver
class EmailHandler
def call(request)
+ return unless request.email
+ handle_request(request)
+ end
+
+ protected
+
+ def handle_request(request)
email = EmailAddress.new(request.email)
if email.invalid?
ErrorResponse.new("Not a valid address")
@@ -16,8 +23,6 @@ module Nickserver
end
end
- protected
-
def send_key(email, request)
if local_address?(email, request)
source = Nickserver::CouchDB::Source.new
diff --git a/lib/nickserver/request_handlers/fingerprint_handler.rb b/lib/nickserver/request_handlers/fingerprint_handler.rb
index 3202c41..3c04fcd 100644
--- a/lib/nickserver/request_handlers/fingerprint_handler.rb
+++ b/lib/nickserver/request_handlers/fingerprint_handler.rb
@@ -6,6 +6,13 @@ module Nickserver
class FingerprintHandler
def call(request)
+ return unless request.fingerprint
+ handle_request(request)
+ end
+
+ protected
+
+ def handle_request(request)
fingerprint = request.fingerprint
if fingerprint.length == 40 && !fingerprint[/\H/]
source = Nickserver::Hkp::Source.new