Skip to content

Commit

Permalink
[coro_http_client][update]Default port (#724)
Browse files Browse the repository at this point in the history
  • Loading branch information
qicosmos authored Jul 22, 2024
1 parent c2c5c40 commit 8fe7242
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.15)
project(yaLanTingLibs
VERSION 0.3.5
VERSION 0.3.6
DESCRIPTION "yaLanTingLibs"
HOMEPAGE_URL "https://github.com/alibaba/yalantinglibs"
LANGUAGES CXX
Expand Down
19 changes: 10 additions & 9 deletions include/ylt/standalone/cinatra/coro_http_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1546,20 +1546,21 @@ class coro_http_client : public std::enable_shared_from_this<coro_http_client> {
if (!proxy_host_.empty() && !proxy_port_.empty()) {
if (!proxy_request_uri_.empty())
proxy_request_uri_.clear();
if (u.get_port() == "http") {
proxy_request_uri_ += "http://" + u.get_host() + ":";
proxy_request_uri_ += "80";
if (u.get_port() == "80") {
proxy_request_uri_.append("http://").append(u.get_host()).append(":80");
}
else if (u.get_port() == "https") {
proxy_request_uri_ += "https://" + u.get_host() + ":";
proxy_request_uri_ += "443";
else if (u.get_port() == "443") {
proxy_request_uri_.append("https://")
.append(u.get_host())
.append(":443");
}
else {
// all be http
proxy_request_uri_ += "http://" + u.get_host() + ":";
proxy_request_uri_ += u.get_port();
proxy_request_uri_.append("http://")
.append(u.get_host())
.append(u.get_port());
}
proxy_request_uri_ += u.get_path();
proxy_request_uri_.append(u.get_path());
u.path = std::string_view(proxy_request_uri_);
}
}
Expand Down
4 changes: 2 additions & 2 deletions include/ylt/standalone/cinatra/uri.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,15 @@ class uri_t {
std::string port_str;
if (is_ssl) {
if (port.empty()) {
port_str = "https";
port_str = "443";
}
else {
port_str = std::string(port);
}
}
else {
if (port.empty()) {
port_str = "http";
port_str = "80";
}
else {
port_str = std::string(port);
Expand Down
2 changes: 1 addition & 1 deletion include/ylt/standalone/cinatra/version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
// CINATRA_VERSION % 100 is the sub-minor version
// CINATRA_VERSION / 100 % 1000 is the minor version
// CINATRA_VERSION / 100000 is the major version
#define CINATRA_VERSION 901 // 0.9.1
#define CINATRA_VERSION 902 // 0.9.2
2 changes: 1 addition & 1 deletion include/ylt/version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
// YLT_VERSION % 100 is the sub-minor version
// YLT_VERSION / 100 % 1000 is the minor version
// YLT_VERSION / 100000 is the major version
#define YLT_VERSION 305 // 0.3.5
#define YLT_VERSION 306 // 0.3.6

0 comments on commit 8fe7242

Please sign in to comment.