Compare commits

...

2 Commits

Author SHA1 Message Date
HoneyryderChuck
52e738b586 Merge branch 'issue-246' into 'master'
fix bug in DoH impl when the request returned no answer

Closes #246

See merge request os85/httpx!273
2023-09-14 18:44:29 +00:00
HoneyryderChuck
c0afc295a5 fix bug in DoH impl when the request returned no answer (Closes #246) 2023-09-14 13:32:04 +01:00
2 changed files with 6 additions and 4 deletions

View File

@ -132,7 +132,7 @@ module HTTPX
case code
when :ok
parse_addresses(result)
parse_addresses(result, request)
when :no_domain_found
# Indicates no such domain was found.
@ -146,13 +146,13 @@ module HTTPX
emit_resolve_error(connection)
when :decode_error
host, connection = @queries.first
reset_hostname(host)
host = @requests.delete(request)
connection = reset_hostname(host)
emit_resolve_error(connection, connection.origin.host, result)
end
end
def parse_addresses(answers)
def parse_addresses(answers, request)
if answers.empty?
# no address found, eliminate candidates
host = @requests.delete(request)

View File

@ -32,6 +32,8 @@ module HTTPX
def parse: (Request request, Response response) -> void
def parse_addresses: (Array[dns_result] answers, Request request) -> void
def build_request: (String hostname) -> Request
def decode_response_body: (Response) -> dns_decoding_response