diff options
author | kerzum <kerzum@yandex-team.ru> | 2022-02-10 16:49:33 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:33 +0300 |
commit | 47a7e7b29636bfb2deb1df5f92363b3c75229c95 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/uri | |
parent | 9a7232babfd763ccfe827bc70e82e0f50cfd8276 (diff) | |
download | ydb-47a7e7b29636bfb2deb1df5f92363b3c75229c95.tar.gz |
Restoring authorship annotation for <kerzum@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/uri')
-rw-r--r-- | library/cpp/uri/common.cpp | 4 | ||||
-rw-r--r-- | library/cpp/uri/parsefsm.rl6 | 14 | ||||
-rw-r--r-- | library/cpp/uri/uri.cpp | 6 | ||||
-rw-r--r-- | library/cpp/uri/uri_ut.cpp | 8 |
4 files changed, 16 insertions, 16 deletions
diff --git a/library/cpp/uri/common.cpp b/library/cpp/uri/common.cpp index 8973027086..05af1e57d1 100644 --- a/library/cpp/uri/common.cpp +++ b/library/cpp/uri/common.cpp @@ -110,6 +110,6 @@ namespace NUri { if (!info.Str.empty()) return info.Str.data(); return TScheme::SchemeEmpty == t ? "empty" : "unknown"; - } - + } + } diff --git a/library/cpp/uri/parsefsm.rl6 b/library/cpp/uri/parsefsm.rl6 index 6bc84bee81..7097723650 100644 --- a/library/cpp/uri/parsefsm.rl6 +++ b/library/cpp/uri/parsefsm.rl6 @@ -141,7 +141,7 @@ ext_ascii = (VALID - ascii) >{ REQ(fpc, FeatureEncodeExtendedASCII) }; ext_delims = ( "[" | "]" | "|" | "{" | "}" | "`" | "^" | "<" | ">" | ( ["\\] >act_req_enc_sql ) - ) >{ REQ(fpc, FeatureEncodeExtendedDelim) }; # " fix hilite + ) >{ REQ(fpc, FeatureEncodeExtendedDelim) }; # " fix hilite ext_space = " " >{ REQ(fpc, FeatureEncodeSpace) }; ext_cntrl = cntrl >{ REQ(fpc, FeatureEncodeCntrl) }; @@ -206,13 +206,13 @@ dec_octet = DIGIT+; IPv4address = dec_octet "." dec_octet "." dec_octet "." dec_octet; - # MOD: non-empty; will use host? + # MOD: non-empty; will use host? # reg-name = *( unreserved / pct-encoded / sub-delims ) - ### todo: allow ':' (need to fix grammar to disambiguate port) - achar = any - (0x00 .. 0x20) - '/' - '#' - '?' - ':' - '%'; - upperhalf = any - (0x00 .. 0x7F); - hostname = (((achar | pct_encoded)+) & (any* (alnum | upperhalf) any*)); - reg_name = hostname - IPv4address - IP_literal; + ### todo: allow ':' (need to fix grammar to disambiguate port) + achar = any - (0x00 .. 0x20) - '/' - '#' - '?' - ':' - '%'; + upperhalf = any - (0x00 .. 0x7F); + hostname = (((achar | pct_encoded)+) & (any* (alnum | upperhalf) any*)); + reg_name = hostname - IPv4address - IP_literal; # uses first-match-wins approach host = IP_literal | IPv4address | (reg_name - IPv4address); diff --git a/library/cpp/uri/uri.cpp b/library/cpp/uri/uri.cpp index cdc1cad7c2..56a9a4e5ef 100644 --- a/library/cpp/uri/uri.cpp +++ b/library/cpp/uri/uri.cpp @@ -384,7 +384,7 @@ namespace NUri { if (!v.empty()) TEncoder::EncodeNotAlnum(out, v); } - + if (flags & FlagPass) { v = Fields[FieldPass]; if (v.IsInited()) { @@ -492,7 +492,7 @@ namespace NUri { for (char* p_rd = p_prev; p_rd; p_rd = p_prev) { Y_ASSERT(p_rd == pathEnd || p_rd[0] == '/'); p_prev = nullptr; - + char* p = p_rd; if (p > pathPtr) { @@ -618,4 +618,4 @@ namespace NUri { return ""; } -} +} diff --git a/library/cpp/uri/uri_ut.cpp b/library/cpp/uri/uri_ut.cpp index 4af6b918e9..2ebd83fc93 100644 --- a/library/cpp/uri/uri_ut.cpp +++ b/library/cpp/uri/uri_ut.cpp @@ -671,18 +671,18 @@ namespace NUri { UNIT_ASSERT_EQUAL(uri.Parse("http://hello_world", TFeature::FeatureCheckHost), TState::ParsedBadHost); UNIT_ASSERT_EQUAL(uri.Parse("http://hello_world", TFeature::FeatureSchemeFlexible), TState::ParsedOK); UNIT_ASSERT_VALUES_EQUAL(uri.GetHost(), "hello_world"); - + UNIT_ASSERT_EQUAL(uri.Parse("httpzzzzz://)(*&^$!\\][';<>`~,q?./index.html", TFeature::FeatureSchemeFlexible), TState::ParsedOK); UNIT_ASSERT_VALUES_EQUAL(uri.GetHost(), ")(*&^$!\\][';<>`~,q"); UNIT_ASSERT_VALUES_EQUAL(uri.GetField(TField::FieldPath), ""); UNIT_ASSERT_VALUES_EQUAL(uri.GetField(TField::FieldQuery), "./index.html"); - + UNIT_ASSERT_EQUAL(uri.Parse("htttttttp://)(*&^%45$!\\][';<>`~,.q/index.html", TFeature::FeatureSchemeFlexible), TState::ParsedOK); UNIT_ASSERT_VALUES_EQUAL(uri.GetHost(), ")(*&^e$!\\][';<>`~,.q"); UNIT_ASSERT_VALUES_EQUAL(uri.GetField(TField::FieldPath), "/index.html"); UNIT_ASSERT_VALUES_EQUAL(uri.GetField(TField::FieldQuery), ""); } - + Y_UNIT_TEST(testSpecialChar) { // test characters which are not always allowed { @@ -899,7 +899,7 @@ namespace NUri { UNIT_ASSERT_VALUES_EQUAL(url.GetHost(), "www.hostname.ru"); UNIT_ASSERT_VALUES_EQUAL(url.GetField(TField::FieldPath), "/path"); } - } + } Y_UNIT_TEST_SUITE(TInvertDomainTest) { Y_UNIT_TEST(TestInvert) { |