FeatherNode: add regex for local node detection

This commit is contained in:
tobtoht 2021-05-24 00:53:13 +02:00
parent 5edea3c436
commit 09639181ba
No known key found for this signature in database
GPG key ID: 1CADD27F41F45C3C

View file

@ -74,7 +74,8 @@ struct FeatherNode {
}
bool isLocal() const {
return (url.host() == "127.0.0.1" || url.host() == "localhost");
QRegularExpression localNetwork(R"((^127\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.))");
return (localNetwork.match(url.host()).hasMatch() || url.host() == "localhost");
}
bool isOnion() const {