Skip to content

Commit

Permalink
RequestServer: Check for empty list of IP addresses in DNS result
Browse files Browse the repository at this point in the history
Before, if something went wrong with DNS lookup and there were unrelated
records (i.e. not A or AAAA) then we would still attempt to build a
resolve list. This resulted in curl errors related to the option itself
and displayed as "unknown network error" to the user.
  • Loading branch information
rmg-x authored and alimpfard committed Feb 2, 2025
1 parent 6d7b7e7 commit 17c0d44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Services/RequestServer/ConnectionFromClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ void ConnectionFromClient::start_request(i32 request_id, ByteString const& metho
async_request_finished(request_id, 0, Requests::NetworkError::UnableToResolveHost);
})
.when_resolved([this, request_id, host, url, method, request_body, request_headers, proxy_data](auto const& dns_result) {
if (dns_result->records().is_empty()) {
if (dns_result->records().is_empty() || dns_result->cached_addresses().is_empty()) {
dbgln("StartRequest: DNS lookup failed for '{}'", host);
async_request_finished(request_id, 0, Requests::NetworkError::UnableToResolveHost);
return;
Expand Down

0 comments on commit 17c0d44

Please sign in to comment.