diff options
author | muzich <muzich@yandex-team.ru> | 2022-02-10 16:49:54 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:54 +0300 |
commit | bf6bd1f317019d83a3f8d5d39c2d0e9d6d705e40 (patch) | |
tree | bfb62aa73647b9e0dea416c9055ba5d5f7302dd7 /library/cpp/string_utils/url/url.cpp | |
parent | 75494e834356f7a748c7193ccb6a5aa4dc981f4f (diff) | |
download | ydb-bf6bd1f317019d83a3f8d5d39c2d0e9d6d705e40.tar.gz |
Restoring authorship annotation for <muzich@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/string_utils/url/url.cpp')
-rw-r--r-- | library/cpp/string_utils/url/url.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/library/cpp/string_utils/url/url.cpp b/library/cpp/string_utils/url/url.cpp index 85f4ac5d69..dfc33d811d 100644 --- a/library/cpp/string_utils/url/url.cpp +++ b/library/cpp/string_utils/url/url.cpp @@ -314,7 +314,7 @@ static inline bool IsSchemeChar(char c) noexcept { return IsAsciiAlnum(c); //what about '+' ?.. } -static bool HasPrefix(const TStringBuf url) noexcept { +static bool HasPrefix(const TStringBuf url) noexcept { TStringBuf scheme, unused; if (!url.TrySplit(TStringBuf("://"), scheme, unused)) return false; @@ -326,7 +326,7 @@ TString AddSchemePrefix(const TString& url) { return AddSchemePrefix(url, TStringBuf("http")); } -TString AddSchemePrefix(const TString& url, TStringBuf scheme) { +TString AddSchemePrefix(const TString& url, TStringBuf scheme) { if (HasPrefix(url)) { return url; } @@ -387,13 +387,13 @@ size_t NormalizeHostName(char* dest, const TStringBuf source, size_t dest_size, strlwr(dest); return len; } - + TStringBuf RemoveFinalSlash(TStringBuf str) noexcept { - if (str.EndsWith('/')) { - str.Chop(1); - } - return str; -} + if (str.EndsWith('/')) { + str.Chop(1); + } + return str; +} TStringBuf CutUrlPrefixes(TStringBuf url) noexcept { url = CutSchemePrefix(url); |