diff options
Diffstat (limited to 'src/net/i2p_address.cpp')
| -rw-r--r-- | src/net/i2p_address.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/net/i2p_address.cpp b/src/net/i2p_address.cpp index 4e21085d0..e793048c0 100644 --- a/src/net/i2p_address.cpp +++ b/src/net/i2p_address.cpp @@ -36,6 +36,7 @@ #include <limits> #include "net/error.h" +#include "net/host.h" #include "serialization/keyvalue_serialization.h" #include "storages/portable_storage.h" #include "string_tools_lexical.h" @@ -105,10 +106,12 @@ namespace net expect<i2p_address> i2p_address::make(const boost::string_ref address) { boost::string_ref host = address.substr(0, address.rfind(':')); - MONERO_CHECK(host_check(host)); + std::string normalized_host{host}; + net::canonicalize_host(normalized_host); + MONERO_CHECK(host_check(normalized_host)); static_assert(b32_length + sizeof(tld) == sizeof(i2p_address::host_), "bad internal host size"); - return i2p_address{host}; + return i2p_address{normalized_host}; } bool i2p_address::_load(epee::serialization::portable_storage& src, epee::serialization::section* hparent) |
