aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp
diff options
context:
space:
mode:
authorolegator <olegator@yandex-team.ru>2022-02-10 16:49:55 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:55 +0300
commit553b4d1ea5e01ab98a8cfa8e3cfed79a0a93972d (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp
parent971cfa1c440a14ae8352b1dbf29a884fea7536db (diff)
downloadydb-553b4d1ea5e01ab98a8cfa8e3cfed79a0a93972d.tar.gz
Restoring authorship annotation for <olegator@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp')
-rw-r--r--library/cpp/string_utils/quote/quote_ut.cpp2
-rw-r--r--library/cpp/string_utils/url/url.cpp12
-rw-r--r--library/cpp/string_utils/url/url.h20
-rw-r--r--library/cpp/string_utils/url/url_ut.cpp38
4 files changed, 36 insertions, 36 deletions
diff --git a/library/cpp/string_utils/quote/quote_ut.cpp b/library/cpp/string_utils/quote/quote_ut.cpp
index 32e7f8fe35..6c552b279e 100644
--- a/library/cpp/string_utils/quote/quote_ut.cpp
+++ b/library/cpp/string_utils/quote/quote_ut.cpp
@@ -26,7 +26,7 @@ Y_UNIT_TEST_SUITE(TCGIEscapeTest) {
}
Y_UNIT_TEST(StrokaRet) {
- UNIT_ASSERT_VALUES_EQUAL(CGIEscapeRet("!@#$%^&*(){}[]\" "), TString("!@%23$%25^%26*%28%29%7B%7D%5B%5D%22+"));
+ UNIT_ASSERT_VALUES_EQUAL(CGIEscapeRet("!@#$%^&*(){}[]\" "), TString("!@%23$%25^%26*%28%29%7B%7D%5B%5D%22+"));
}
Y_UNIT_TEST(StrokaAppendRet) {
diff --git a/library/cpp/string_utils/url/url.cpp b/library/cpp/string_utils/url/url.cpp
index 38fab59416..85f4ac5d69 100644
--- a/library/cpp/string_utils/url/url.cpp
+++ b/library/cpp/string_utils/url/url.cpp
@@ -182,18 +182,18 @@ TStringBuf GetSchemeHostAndPort(const TStringBuf url, bool trimHttp, bool trimDe
}
}
-void SplitUrlToHostAndPath(const TStringBuf url, TStringBuf& host, TStringBuf& path) {
+void SplitUrlToHostAndPath(const TStringBuf url, TStringBuf& host, TStringBuf& path) {
auto [hostBuf, pathBuf] = NUrl::SplitUrlToHostAndPath(url);
host = hostBuf;
path = pathBuf;
-}
-
-void SplitUrlToHostAndPath(const TStringBuf url, TString& host, TString& path) {
+}
+
+void SplitUrlToHostAndPath(const TStringBuf url, TString& host, TString& path) {
auto [hostBuf, pathBuf] = NUrl::SplitUrlToHostAndPath(url);
host = hostBuf;
path = pathBuf;
-}
-
+}
+
void SeparateUrlFromQueryAndFragment(const TStringBuf url, TStringBuf& sanitizedUrl, TStringBuf& query, TStringBuf& fragment) {
TStringBuf urlWithoutFragment;
if (!url.TrySplit('#', urlWithoutFragment, fragment)) {
diff --git a/library/cpp/string_utils/url/url.h b/library/cpp/string_utils/url/url.h
index 5d6c751e4c..84137ccc57 100644
--- a/library/cpp/string_utils/url/url.h
+++ b/library/cpp/string_utils/url/url.h
@@ -73,16 +73,16 @@ Y_PURE_FUNCTION
TStringBuf GetSchemeHostAndPort(const TStringBuf url, bool trimHttp = true, bool trimDefaultPort = true) noexcept;
/**
- * Splits URL to host and path
- *
- * @param[in] url any URL
- * @param[out] host parsed host
- * @param[out] path parsed path
- */
-void SplitUrlToHostAndPath(const TStringBuf url, TStringBuf& host, TStringBuf& path);
-void SplitUrlToHostAndPath(const TStringBuf url, TString& host, TString& path);
-
-/**
+ * Splits URL to host and path
+ *
+ * @param[in] url any URL
+ * @param[out] host parsed host
+ * @param[out] path parsed path
+ */
+void SplitUrlToHostAndPath(const TStringBuf url, TStringBuf& host, TStringBuf& path);
+void SplitUrlToHostAndPath(const TStringBuf url, TString& host, TString& path);
+
+/**
* Separates URL into url prefix, query (aka cgi params list), and fragment (aka part after #)
*
* @param[in] url any URL
diff --git a/library/cpp/string_utils/url/url_ut.cpp b/library/cpp/string_utils/url/url_ut.cpp
index d0971b1007..1588013893 100644
--- a/library/cpp/string_utils/url/url_ut.cpp
+++ b/library/cpp/string_utils/url/url_ut.cpp
@@ -128,29 +128,29 @@ Y_UNIT_TEST_SUITE(TUtilUrlTest) {
}
Y_UNIT_TEST(TestSplitUrlToHostAndPath) {
- TStringBuf host, path;
-
- SplitUrlToHostAndPath("https://yandex.ru/yandsearch", host, path);
- UNIT_ASSERT_STRINGS_EQUAL(host, "https://yandex.ru");
- UNIT_ASSERT_STRINGS_EQUAL(path, "/yandsearch");
-
- SplitUrlToHostAndPath("yandex.ru/yandsearch", host, path);
- UNIT_ASSERT_STRINGS_EQUAL(host, "yandex.ru");
- UNIT_ASSERT_STRINGS_EQUAL(path, "/yandsearch");
-
- SplitUrlToHostAndPath("https://yandex.ru", host, path);
- UNIT_ASSERT_STRINGS_EQUAL(host, "https://yandex.ru");
- UNIT_ASSERT_STRINGS_EQUAL(path, "");
-
- SplitUrlToHostAndPath("invalid url /", host, path);
- UNIT_ASSERT_STRINGS_EQUAL(host, "invalid url ");
- UNIT_ASSERT_STRINGS_EQUAL(path, "/");
+ TStringBuf host, path;
+
+ SplitUrlToHostAndPath("https://yandex.ru/yandsearch", host, path);
+ UNIT_ASSERT_STRINGS_EQUAL(host, "https://yandex.ru");
+ UNIT_ASSERT_STRINGS_EQUAL(path, "/yandsearch");
+
+ SplitUrlToHostAndPath("yandex.ru/yandsearch", host, path);
+ UNIT_ASSERT_STRINGS_EQUAL(host, "yandex.ru");
+ UNIT_ASSERT_STRINGS_EQUAL(path, "/yandsearch");
+
+ SplitUrlToHostAndPath("https://yandex.ru", host, path);
+ UNIT_ASSERT_STRINGS_EQUAL(host, "https://yandex.ru");
+ UNIT_ASSERT_STRINGS_EQUAL(path, "");
+
+ SplitUrlToHostAndPath("invalid url /", host, path);
+ UNIT_ASSERT_STRINGS_EQUAL(host, "invalid url ");
+ UNIT_ASSERT_STRINGS_EQUAL(path, "/");
SplitUrlToHostAndPath("some_blender_url", host, path);
UNIT_ASSERT_STRINGS_EQUAL(host, "some_blender_url");
UNIT_ASSERT_STRINGS_EQUAL(path, "");
- }
-
+ }
+
Y_UNIT_TEST(TestSeparateUrlFromQueryAndFragment) {
TStringBuf sanitizedUrl, query, fragment;