From a095901ec045013460957889afa03324b86c424c Mon Sep 17 00:00:00 2001 From: woodser Date: Mon, 6 Jan 2025 08:54:03 -0500 Subject: [PATCH] assign default port for http and https clients --- contrib/epee/src/abstract_http_client.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contrib/epee/src/abstract_http_client.cpp b/contrib/epee/src/abstract_http_client.cpp index 8897ad9ae..31a98260f 100644 --- a/contrib/epee/src/abstract_http_client.cpp +++ b/contrib/epee/src/abstract_http_client.cpp @@ -125,6 +125,13 @@ namespace http http::url_content parsed{}; const bool r = parse_url(address, parsed); 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)); return true; }