mirror of
https://github.com/monero-project/monero.git
synced 2024-12-23 03:59:33 +00:00
util: consider Tor/I2P addresses to be non local
This commit is contained in:
parent
8962f0032f
commit
941a608d52
1 changed files with 7 additions and 0 deletions
|
@ -657,6 +657,13 @@ std::string get_nix_version_display_string()
|
||||||
|
|
||||||
bool is_local_address(const std::string &address)
|
bool is_local_address(const std::string &address)
|
||||||
{
|
{
|
||||||
|
// always assume Tor/I2P addresses to be untrusted by default
|
||||||
|
if (boost::ends_with(address, ".onion") || boost::ends_with(address, ".i2p"))
|
||||||
|
{
|
||||||
|
MDEBUG("Address '" << address << "' is Tor/I2P, non local");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// extract host
|
// extract host
|
||||||
epee::net_utils::http::url_content u_c;
|
epee::net_utils::http::url_content u_c;
|
||||||
if (!epee::net_utils::parse_url(address, u_c))
|
if (!epee::net_utils::parse_url(address, u_c))
|
||||||
|
|
Loading…
Reference in a new issue