lib/httpx/resolver/https.rb in httpx-0.9.0 vs lib/httpx/resolver/https.rb in httpx-0.10.0

- old
+ new

@@ -92,11 +92,16 @@ end def resolve(connection = @connections.first, hostname = nil) return if @building_connection - hostname = hostname || @queries.key(connection) || connection.origin.host + hostname ||= @queries.key(connection) + + if hostname.nil? + hostname = connection.origin.host + log { "resolver: resolve IDN #{connection.origin.non_ascii_hostname} as #{hostname}" } if connection.origin.non_ascii_hostname + end type = @_record_types[hostname].first log { "resolver: query #{type} for #{hostname}" } begin request = build_request(hostname, type) @requests[request] = connection @@ -204,10 +209,10 @@ def decode_response_body(response) case response.headers["content-type"] when "application/dns-json", "application/json", - %r{^application\/x\-javascript} # because google... + %r{^application/x-javascript} # because google... payload = JSON.parse(response.to_s) payload["Answer"] when "application/dns-udpwireformat", "application/dns-message" Resolver.decode_dns_answer(response.to_s)