From cd1bbe970ca17034b0e380ff2996542e3af81e31 Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 29 Aug 2016 12:51:00 +0200 Subject: 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. --- lib/nickserver/request_handlers/local_email_handler.rb | 7 ------- 1 file changed, 7 deletions(-) (limited to 'lib/nickserver') 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 -- cgit v1.2.3