mirror of
https://github.com/monero-project/monero.git
synced 2025-02-23 12:39:50 -05:00
Merge pull request #9439
02e2a4f4c assign default port for http and https clients (woodser)
This commit is contained in:
commit
aae0c7743a
@ -125,6 +125,13 @@ namespace http
|
|||||||
http::url_content parsed{};
|
http::url_content parsed{};
|
||||||
const bool r = parse_url(address, parsed);
|
const bool r = parse_url(address, parsed);
|
||||||
CHECK_AND_ASSERT_MES(r, false, "failed to parse url: " << address);
|
CHECK_AND_ASSERT_MES(r, false, "failed to parse url: " << address);
|
||||||
|
if (parsed.port == 0)
|
||||||
|
{
|
||||||
|
if (parsed.schema == "http")
|
||||||
|
parsed.port = 80;
|
||||||
|
else if (parsed.schema == "https")
|
||||||
|
parsed.port = 443;
|
||||||
|
}
|
||||||
set_server(std::move(parsed.host), std::to_string(parsed.port), std::move(user), std::move(ssl_options));
|
set_server(std::move(parsed.host), std::to_string(parsed.port), std::move(user), std::move(ssl_options));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user