Skip to content

Commit fd65406

Browse files
committed
net: preserve network name case in proxy errors
`-proxy` lowercases unsupported network names in its error message, unlike `-onlynet` and `getnodeaddresses`. Let the shared parser handle case-insensitive matching so the diagnostic retains the user's spelling.
1 parent b037574 commit fd65406

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/init.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1761,7 +1761,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
17611761
if (eq_pos + 1 == param_value.length()) {
17621762
return InitError(strprintf(_("Invalid -proxy address or hostname, ends with '=': '%s'"), param_value));
17631763
}
1764-
net_str = ToLower(param_value.substr(eq_pos + 1)); // e.g. 127.0.0.1:9050=ipv4 -> ipv4
1764+
net_str = param_value.substr(eq_pos + 1); // e.g. 127.0.0.1:9050=ipv4 -> ipv4
17651765
}
17661766

17671767
Proxy proxy;

‎test/functional/feature_proxy.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ def networks_dict(d):
455455
self.log.info("Test unknown, removed and non-SOCKS5 network names are rejected by -proxy")
456456
for network in ["Foo", "tor", "i2p"]:
457457
self.nodes[1].extra_args = [f"-proxy=127.0.0.1:9050={network}"]
458-
msg = f"Error: Unrecognized network in -proxy='127.0.0.1:9050={network}': '{network.lower()}'" # TODO: The error must identify the invalid input exactly
458+
msg = f"Error: Unrecognized network in -proxy='127.0.0.1:9050={network}': '{network}'"
459459
self.nodes[1].assert_start_raises_init_error(expected_msg=msg)
460460

461461
self.log.info("Test passing proxy only for IPv6")

0 commit comments

Comments
 (0)