Improve dualstack and IPv6 support (#5449)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Jimmy Hedman
2024-02-27 09:16:20 +01:00
committed by GitHub
parent 5e04914a11
commit f73518dbeb
26 changed files with 300 additions and 140 deletions
@@ -21,8 +21,13 @@ std::string ImprovBase::get_formatted_next_url_() {
// Ip address
pos = this->next_url_.find("{{ip_address}}");
if (pos != std::string::npos) {
std::string ip = network::get_ip_address().str();
copy.replace(pos, 14, ip);
for (auto &ip : network::get_ip_addresses()) {
if (ip.is_ip4()) {
std::string ipa = ip.str();
copy.replace(pos, 14, ipa);
break;
}
}
}
return copy;