diff --git a/Net/src/HTTPClientSession.cpp b/Net/src/HTTPClientSession.cpp index 0fa57689b1..323e9526df 100644 --- a/Net/src/HTTPClientSession.cpp +++ b/Net/src/HTTPClientSession.cpp @@ -429,8 +429,13 @@ std::string HTTPClientSession::proxyRequestPrefix() const { std::string result("http://"); result.append(_host); - result.append(":"); - NumberFormatter::append(result, _port); + /// Do not append default by default, since this may break some servers. + /// One example of such server is GCS (Google Cloud Storage). + if (_port != HTTPSession::HTTP_PORT) + { + result.append(":"); + NumberFormatter::append(result, _port); + } return result; } diff --git a/NetSSL_OpenSSL/src/HTTPSClientSession.cpp b/NetSSL_OpenSSL/src/HTTPSClientSession.cpp index 62b6f6e3ed..91c87bd70b 100644 --- a/NetSSL_OpenSSL/src/HTTPSClientSession.cpp +++ b/NetSSL_OpenSSL/src/HTTPSClientSession.cpp @@ -138,8 +138,13 @@ std::string HTTPSClientSession::proxyRequestPrefix() const { std::string result("https://"); result.append(getHost()); - result.append(":"); - NumberFormatter::append(result, getPort()); + /// Do not append default by default, since this may break some servers. + /// One example of such server is GCS (Google Cloud Storage). + if (getPort() != HTTPS_PORT) + { + result.append(":"); + NumberFormatter::append(result, getPort()); + } return result; }