aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/string_utils/url
diff options
context:
space:
mode:
authorkartynnik <kartynnik@yandex-team.ru>2022-02-10 16:48:07 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:07 +0300
commitca2a705e6e39e85df30054d7e806e572de9cfe23 (patch)
treefb7cc52bc2579366b2796a24f91f6df7a223f9ab /library/cpp/string_utils/url
parente20e2b362f0232ed5a389db887e6e27e7763af18 (diff)
downloadydb-ca2a705e6e39e85df30054d7e806e572de9cfe23.tar.gz
Restoring authorship annotation for <kartynnik@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/string_utils/url')
-rw-r--r--library/cpp/string_utils/url/url.cpp8
-rw-r--r--library/cpp/string_utils/url/url_ut.cpp2
2 files changed, 5 insertions, 5 deletions
diff --git a/library/cpp/string_utils/url/url.cpp b/library/cpp/string_utils/url/url.cpp
index 85f4ac5d69..2e7c68a7ae 100644
--- a/library/cpp/string_utils/url/url.cpp
+++ b/library/cpp/string_utils/url/url.cpp
@@ -125,10 +125,10 @@ TStringBuf CutSchemePrefix(const TStringBuf url) noexcept {
template <bool KeepPort>
static inline TStringBuf GetHostAndPortImpl(const TStringBuf url) {
- TStringBuf urlNoScheme = url;
-
- urlNoScheme.Skip(GetHttpPrefixSize(url));
+ TStringBuf urlNoScheme = url;
+ urlNoScheme.Skip(GetHttpPrefixSize(url));
+
struct TDelim: public str_spn {
inline TDelim()
: str_spn(KeepPort ? "/;?#" : "/:;?#")
@@ -137,7 +137,7 @@ static inline TStringBuf GetHostAndPortImpl(const TStringBuf url) {
};
const auto& nonHostCharacters = *Singleton<TDelim>();
- const char* firstNonHostCharacter = nonHostCharacters.brk(urlNoScheme.begin(), urlNoScheme.end());
+ const char* firstNonHostCharacter = nonHostCharacters.brk(urlNoScheme.begin(), urlNoScheme.end());
if (firstNonHostCharacter != urlNoScheme.end()) {
return urlNoScheme.substr(0, firstNonHostCharacter - urlNoScheme.data());
diff --git a/library/cpp/string_utils/url/url_ut.cpp b/library/cpp/string_utils/url/url_ut.cpp
index 1588013893..63b579db7d 100644
--- a/library/cpp/string_utils/url/url_ut.cpp
+++ b/library/cpp/string_utils/url/url_ut.cpp
@@ -15,7 +15,7 @@ Y_UNIT_TEST_SUITE(TUtilUrlTest) {
UNIT_ASSERT_VALUES_EQUAL("ya.ru", GetHost("ya.ru/bebe:8080"));
UNIT_ASSERT_VALUES_EQUAL("ya.ru", GetHostAndPort("ya.ru/bebe:8080"));
UNIT_ASSERT_VALUES_EQUAL("ya.ru", GetHost("ya.ru:8080/bebe"));
- UNIT_ASSERT_VALUES_EQUAL("ya.ru", GetHost("https://ya.ru:8080/bebe"));
+ UNIT_ASSERT_VALUES_EQUAL("ya.ru", GetHost("https://ya.ru:8080/bebe"));
UNIT_ASSERT_VALUES_EQUAL("www.ya.ru", GetHost("www.ya.ru:8080/bebe"));
UNIT_ASSERT_VALUES_EQUAL("www.ya.ru", GetHost("https://www.ya.ru:8080/bebe"));
UNIT_ASSERT_VALUES_EQUAL("ya.ru:8080", GetHostAndPort("ya.ru:8080/bebe"));