mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 22:55:23 +00:00
RequestServer: Remove IPV6 bracket notation on host before resolving
Previously, we were passing in the serialized value which included square brackets but that isn't a valid IPV6 address.
This commit is contained in:
@@ -353,6 +353,11 @@ void ConnectionFromClient::start_request(i32 request_id, ByteString const& metho
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto host = url.serialized_host().to_byte_string();
|
auto host = url.serialized_host().to_byte_string();
|
||||||
|
|
||||||
|
// Check if host has the bracket notation for IPV6 addresses and remove them
|
||||||
|
if (host.starts_with("["sv) && host.ends_with("]"sv))
|
||||||
|
host = host.substring(1, host.length() - 2);
|
||||||
|
|
||||||
m_resolver->dns.lookup(host, DNS::Messages::Class::IN, { DNS::Messages::ResourceType::A, DNS::Messages::ResourceType::AAAA })
|
m_resolver->dns.lookup(host, DNS::Messages::Class::IN, { DNS::Messages::ResourceType::A, DNS::Messages::ResourceType::AAAA })
|
||||||
->when_rejected([this, request_id](auto const& error) {
|
->when_rejected([this, request_id](auto const& error) {
|
||||||
dbgln("StartRequest: DNS lookup failed: {}", error);
|
dbgln("StartRequest: DNS lookup failed: {}", error);
|
||||||
|
|||||||
Reference in New Issue
Block a user