mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 03:25:13 +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:
parent
23a8bbca01
commit
41c6f93aa8
Notes:
github-actions[bot]
2025-02-17 11:03:35 +00:00
Author: https://github.com/rmg-x Commit: https://github.com/LadybirdBrowser/ladybird/commit/41c6f93aa82 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3597
1 changed files with 5 additions and 0 deletions
|
@ -353,6 +353,11 @@ void ConnectionFromClient::start_request(i32 request_id, ByteString const& metho
|
|||
}
|
||||
|
||||
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 })
|
||||
->when_rejected([this, request_id](auto const& error) {
|
||||
dbgln("StartRequest: DNS lookup failed: {}", error);
|
||||
|
|
Loading…
Add table
Reference in a new issue