aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/uri
diff options
context:
space:
mode:
authorleo <leo@yandex-team.ru>2022-02-10 16:46:40 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:40 +0300
commit99609724f661f7e21d1cb08e8d80e87c3632fdb3 (patch)
tree49e222ea1c5804306084bb3ae065bb702625360f /library/cpp/uri
parent980edcd3304699edf9d4e4d6a656e585028e2a72 (diff)
downloadydb-99609724f661f7e21d1cb08e8d80e87c3632fdb3.tar.gz
Restoring authorship annotation for <leo@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/uri')
-rw-r--r--library/cpp/uri/common.cpp4
-rw-r--r--library/cpp/uri/uri-ru_ut.cpp12
-rw-r--r--library/cpp/uri/uri.cpp4
-rw-r--r--library/cpp/uri/uri.h6
-rw-r--r--library/cpp/uri/uri_ut.cpp18
5 files changed, 22 insertions, 22 deletions
diff --git a/library/cpp/uri/common.cpp b/library/cpp/uri/common.cpp
index d3623f8208..05af1e57d1 100644
--- a/library/cpp/uri/common.cpp
+++ b/library/cpp/uri/common.cpp
@@ -103,8 +103,8 @@ namespace NUri {
default:
return "Field[Unknown]";
}
- }
-
+ }
+
const char* SchemeKindToString(const TScheme::EKind& t) {
const TSchemeInfo& info = TSchemeInfo::Get(t);
if (!info.Str.empty())
diff --git a/library/cpp/uri/uri-ru_ut.cpp b/library/cpp/uri/uri-ru_ut.cpp
index 0cbc7a9472..ec35a164d2 100644
--- a/library/cpp/uri/uri-ru_ut.cpp
+++ b/library/cpp/uri/uri-ru_ut.cpp
@@ -2,7 +2,7 @@
#include <library/cpp/charset/recyr.hh>
#include <library/cpp/html/entity/htmlentity.h>
#include <util/system/maxlen.h>
-
+
namespace NUri {
namespace {
TString AsWin1251(const TString& s) {
@@ -70,7 +70,7 @@ namespace NUri {
"images\nil.jpg", "images%0Ail.jpg",
"http://caedebaturque.termez.su\r\n/?article=218", "http://caedebaturque.termez.su%0D%0A/?article=218",
-
+
AsKoi8("javascript:window.external.AddFavorite(\'http://www.humor.look.ru/\',\'Злобные Деды Морозы!!!\')"), "javascript:window.external.AddFavorite(\'http://www.humor.look.ru/\',\'%FA%CC%CF%C2%CE%D9%C5%20%E4%C5%C4%D9%20%ED%CF%D2%CF%DA%D9!!!\')",
"search.php?search_author=%CB%FE%E4%EC%E8%EB%E0+%C3%F3%F1%E5%E2%E0&amp;showresults=posts&amp;sid=8", "search.php?search_author=%CB%FE%E4%EC%E8%EB%E0+%C3%F3%F1%E5%E2%E0&showresults=posts&sid=8",
AsWin1251("/Search/author/?q=Штрибель Х.В."), "/Search/author/?q=%D8%F2%F0%E8%E1%E5%EB%FC%20%D5.%C2.",
@@ -108,7 +108,7 @@ namespace NUri {
"/a-mp3/stype-1/?search=Э", "/a-mp3/stype-1/?search=%D0%AD",
"/a-mp3/stype-1/?search=Ю", "/a-mp3/stype-1/?search=%D0%AE",
"/a-mp3/stype-1/?search=Я", "/a-mp3/stype-1/?search=%D0%AF",
-
+
"javascript:emoticon(\":&#39;(\")", "javascript:emoticon(\":\'(\")",
"javascript:emoticon(\'&gt;:o\')", "javascript:emoticon(\'>:o\')",
"javascript:emoticon(\']:-&gt;\')", "javascript:emoticon(\']:->\')",
@@ -119,7 +119,7 @@ namespace NUri {
"&quot;http://www.fubix.ru&quot;", "\"http://www.fubix.ru\"",
AsWin1251("mailto:&#107;&#97;&#109;&#112;&#97;&#64;&#117;&#107;&#114;&#46;&#110;&#101;&#116;?subject=Арабский язык"), "mailto:kampa@ukr.net?subject=%C0%F0%E0%E1%F1%EA%E8%E9%20%FF%E7%FB%EA",
{}};
-
+
Y_UNIT_TEST(testHtLinkDecode) {
char decodedlink[URL_MAXLEN + 10];
for (int i = 0; links[i]; i += 2) {
@@ -127,7 +127,7 @@ namespace NUri {
UNIT_ASSERT_VALUES_EQUAL(decodedlink, links[i + 1]);
}
}
-
+
Y_UNIT_TEST(testRuIDNA) {
{
#define DEC "\xD7\xE5\xF0\xE5\xEf\xEE\xE2\xE5\xF6.\xF0\xF4" /* "Череповец.рф" in Windows-1251 */
@@ -160,4 +160,4 @@ namespace NUri {
}
}
-}
+}
diff --git a/library/cpp/uri/uri.cpp b/library/cpp/uri/uri.cpp
index 2bb3ceac24..56a9a4e5ef 100644
--- a/library/cpp/uri/uri.cpp
+++ b/library/cpp/uri/uri.cpp
@@ -616,6 +616,6 @@ namespace NUri {
}
Y_ASSERT(0);
return "";
- }
-
+ }
+
}
diff --git a/library/cpp/uri/uri.h b/library/cpp/uri/uri.h
index f6dc8426a2..3b6c19fe4a 100644
--- a/library/cpp/uri/uri.h
+++ b/library/cpp/uri/uri.h
@@ -534,7 +534,7 @@ namespace NUri {
Y_ASSERT(IsValidAbs() && other.IsValidAbs());
return Equal(other, FlagScheme | FlagHostPort);
}
-
+
TLinkType Locality(const TUri& other) const {
if (IsSameDocument(other))
return LinkIsFragment;
@@ -542,11 +542,11 @@ namespace NUri {
return LinkIsLocal;
return LinkIsGlobal;
}
-
+
static IOutputStream& ReEncodeField(IOutputStream& out, const TStringBuf& val, EField fld, long flags = FeaturesEncodeDecode) {
return NEncode::TEncoder::ReEncode(out, val, NEncode::TEncodeMapper(flags, fld));
}
-
+
static IOutputStream& ReEncodeToField(IOutputStream& out, const TStringBuf& val, EField srcfld, long srcflags, EField dstfld, long dstflags) {
return NEncode::TEncoder::ReEncodeTo(out, val, NEncode::TEncodeMapper(srcflags, srcfld), NEncode::TEncodeToMapper(dstflags, dstfld));
}
diff --git a/library/cpp/uri/uri_ut.cpp b/library/cpp/uri/uri_ut.cpp
index 1939d3730d..2ebd83fc93 100644
--- a/library/cpp/uri/uri_ut.cpp
+++ b/library/cpp/uri/uri_ut.cpp
@@ -4,7 +4,7 @@
#include <library/cpp/html/entity/htmlentity.h>
#include <util/system/maxlen.h>
-
+
namespace NUri {
Y_UNIT_TEST_SUITE(URLTest) {
static const char* urls[] = {
@@ -66,7 +66,7 @@ namespace NUri {
UNIT_ASSERT_VALUES_EQUAL(er, TState::ParsedOK);
UNIT_ASSERT(base.IsValidAbs());
UNIT_ASSERT_VALUES_EQUAL(base.PrintS(), urls[0]);
-
+
TString errbuf;
TStringOutput out(errbuf);
const long mflag = TFeature::FeaturesAll;
@@ -75,12 +75,12 @@ namespace NUri {
UNIT_ASSERT_VALUES_EQUAL_C(er, TState::ParsedOK, urls[i]);
rel.Merge(base);
UNIT_ASSERT_VALUES_EQUAL_C(rel.PrintS(), urls[i + 1], urls[i]);
-
+
// try the same thing differently
er = rel.Parse(urls[i], mflag, urls[0]);
UNIT_ASSERT_VALUES_EQUAL_C(er, TState::ParsedOK, urls[i]);
UNIT_ASSERT_VALUES_EQUAL_C(rel.PrintS(), urls[i + 1], urls[i]);
-
+
// lastly...
er = abs.Parse(urls[i + 1], mflag);
UNIT_ASSERT_VALUES_EQUAL(er, TState::ParsedOK);
@@ -120,7 +120,7 @@ namespace NUri {
const char* const result;
TUri::TLinkType ltype;
};
-
+
static const Link4Norm link4Norm[] = {
{"http://www.alltest.ru/all.php?a=aberporth", "http://www.alltest.ru/all.php?a=domestic jobs", "", TUri::LinkIsBad},
{"http://www.alltest.ru/all.php?a=aberporth", "http://www.alltest.ru/all.php?a=domestic%20jobs", "http://www.alltest.ru/all.php?a=domestic%20jobs", TUri::LinkIsLocal},
@@ -130,7 +130,7 @@ namespace NUri {
Y_UNIT_TEST(test_httpURLNormalize) {
TUri normalizedLink;
-
+
for (int i = 0; link4Norm[i].link; i++) {
TUri base;
TState::EParsed er = base.Parse(link4Norm[i].base);
@@ -141,14 +141,14 @@ namespace NUri {
UNIT_ASSERT_VALUES_EQUAL_C(s, link4Norm[i].result, link4Norm[i].link);
}
}
-
+
static const char* urlsWithMultipleSlash[] = {
"http://a/http://b", "http://a/http://b",
"http://a/https://b", "http://a/https://b",
"http://a/b://c", "http://a/b:/c",
"http://a/b//c", "http://a/b/c",
nullptr, nullptr};
-
+
Y_UNIT_TEST(test_httpURLPathOperation) {
char copyUrl[URL_MAXLEN];
for (int i = 0; urlsWithMultipleSlash[i]; i += 2) {
@@ -164,7 +164,7 @@ namespace NUri {
UNIT_ASSERT_VALUES_EQUAL_C(uri.PrintS(), normurl, url);
}
}
-
+
static const char* hostsForCheckHost[] = {
"simplehost.ru",
"third_level.host.ru",