summaryrefslogtreecommitdiff
path: root/lib/nickserver
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2016-08-29 12:51:00 +0200
committerAzul <azul@riseup.net>2016-08-30 08:25:16 +0200
commitcd1bbe970ca17034b0e380ff2996542e3af81e31 (patch)
tree6090adda14bee5443d164a13f8f499ae92c3ed73 /lib/nickserver
parent6e2d31e3f7c515f65d92533bcdb035438461a00c (diff)
feature: keep trying if no Host header given
So far we would error out if no host was specified in the config or the request. It's true that we can't do local lookup if we don't know our own domain. However we can still use HKP. In the future we will query leaps own API for other providers. If the host was not set in the initial request we might even proxy a request to ourselves. Providing the Host header will prevent an infinite loop in that case.
Diffstat (limited to 'lib/nickserver')
-rw-r--r--lib/nickserver/request_handlers/local_email_handler.rb7
1 files changed, 0 insertions, 7 deletions
diff --git a/lib/nickserver/request_handlers/local_email_handler.rb b/lib/nickserver/request_handlers/local_email_handler.rb
index 1f2abc2..9e8ed48 100644
--- a/lib/nickserver/request_handlers/local_email_handler.rb
+++ b/lib/nickserver/request_handlers/local_email_handler.rb
@@ -9,7 +9,6 @@ module Nickserver
def call(request)
return nil unless request.email
domain = Config.domain || request.domain
- return missing_domain_response if domain.nil? || domain == ''
email = EmailAddress.new(request.email)
return nil unless email.domain?(domain)
source.query email
@@ -17,16 +16,10 @@ module Nickserver
protected
- attr_reader :domain
-
def source
Nickserver::CouchDB::Source.new
end
- def missing_domain_response
- ErrorResponse.new "HTTP request must include a Host header."
- end
-
end
end
end