diff options
author | Alexander Smirnov <alex@ydb.tech> | 2025-02-01 00:51:40 +0000 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2025-02-01 00:51:40 +0000 |
commit | bc8b47be9c7f60e7194d1e834f4d57ee1b830d52 (patch) | |
tree | ef2e54f1b2e1fad9870b3df17f6ffaaa402a1637 /library/cpp | |
parent | 28b42072a94e399b79032d7197a0e9c170e2cff0 (diff) | |
parent | 6bdb8392267259f3f148458ab5946e2654631bfc (diff) | |
download | ydb-bc8b47be9c7f60e7194d1e834f4d57ee1b830d52.tar.gz |
Merge branch 'rightlib' into merge-libs-250201-0050
Diffstat (limited to 'library/cpp')
-rw-r--r-- | library/cpp/http/simple/http_client.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/library/cpp/http/simple/http_client.cpp b/library/cpp/http/simple/http_client.cpp index 00145c804f9..bac6bdc39ed 100644 --- a/library/cpp/http/simple/http_client.cpp +++ b/library/cpp/http/simple/http_client.cpp @@ -327,9 +327,18 @@ void TRedirectableHttpClient::ProcessResponse(const TStringBuf relativeUrl, THtt TStringBuf schemeHostPort = GetSchemeHostAndPort(i->Value()); TStringBuf scheme("http://"); TStringBuf host("unknown"); - ui16 port = 80; + ui16 port = 0; GetSchemeHostAndPort(schemeHostPort, scheme, host, port); TStringBuf body = GetPathAndQuery(i->Value(), false); + if (port == 0) { + if (scheme.StartsWith("https")) { + port = 443; + } else if (scheme.StartsWith("http")) { + port = 80; + } else { + port = 80; + } + } auto opts = Opts; opts.Host(TString(scheme) + TString(host)); |