diff options
author | vlid <vlid@yandex-team.ru> | 2022-02-10 16:49:50 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:50 +0300 |
commit | d94c2eed82b3c1259ac7320eb28e9731cd990c22 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/http/fetch | |
parent | d331afa299a67de4e1afaf388f4edd5584a3c92f (diff) | |
download | ydb-d94c2eed82b3c1259ac7320eb28e9731cd990c22.tar.gz |
Restoring authorship annotation for <vlid@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/http/fetch')
-rw-r--r-- | library/cpp/http/fetch/httpfsm.rl6 | 2 | ||||
-rw-r--r-- | library/cpp/http/fetch/httpfsm_ut.cpp | 26 |
2 files changed, 14 insertions, 14 deletions
diff --git a/library/cpp/http/fetch/httpfsm.rl6 b/library/cpp/http/fetch/httpfsm.rl6 index 68ba819f33..eab0328b18 100644 --- a/library/cpp/http/fetch/httpfsm.rl6 +++ b/library/cpp/http/fetch/httpfsm.rl6 @@ -224,7 +224,7 @@ mime_type = "text/plain"i %{c(MIME_TEXT)} | ( "application/x-tar"i | "application/x-ustar"i | "application/x-gtar"i | "application/zip"i | "application/x-archive"i | "application/x-bzip2"i | "application/x-rar"i ) %{c(MIME_ARCHIVE)} | "application/x-dosexec"i %{c(MIME_EXE)} - | "application/x-gzip"i %{c(MIME_GZIP)} + | "application/x-gzip"i %{c(MIME_GZIP)} | "application/json"i %{c(MIME_JSON)} | ("application/javascript"i | "text/javascript"i) %{c(MIME_JAVASCRIPT)} | "application/vnd.android.package-archive"i %{c(MIME_APK)} diff --git a/library/cpp/http/fetch/httpfsm_ut.cpp b/library/cpp/http/fetch/httpfsm_ut.cpp index ba5a011e0b..b018e80101 100644 --- a/library/cpp/http/fetch/httpfsm_ut.cpp +++ b/library/cpp/http/fetch/httpfsm_ut.cpp @@ -60,7 +60,7 @@ public: void TestRelCanonical(); void TestHreflang(); void TestHreflangOnLongInput(); - void TestMimeType(); + void TestMimeType(); void TestRepeatedContentEncoding(); }; @@ -447,20 +447,20 @@ void THttpHeaderParserTestSuite::TestRequestHeaderOnResponse() { TestFinish(); } -void THttpHeaderParserTestSuite::TestMimeType() { - TestStart(); - THttpHeader httpHeader; - httpHeaderParser->Init(&httpHeader); +void THttpHeaderParserTestSuite::TestMimeType() { + TestStart(); + THttpHeader httpHeader; + httpHeaderParser->Init(&httpHeader); const char* headers = - "HTTP/1.1 200 OK\r\n" - "Content-Type: application/json; charset=utf-8\r\n\r\n"; - i32 result = httpHeaderParser->Execute(headers, strlen(headers)); - UNIT_ASSERT_EQUAL(result, 2); - UNIT_ASSERT_EQUAL(httpHeader.mime_type, static_cast<ui8>(MIME_JSON)); + "HTTP/1.1 200 OK\r\n" + "Content-Type: application/json; charset=utf-8\r\n\r\n"; + i32 result = httpHeaderParser->Execute(headers, strlen(headers)); + UNIT_ASSERT_EQUAL(result, 2); + UNIT_ASSERT_EQUAL(httpHeader.mime_type, static_cast<ui8>(MIME_JSON)); UNIT_ASSERT_EQUAL(httpHeader.charset, static_cast<ui8>(CODES_UTF8)); - TestFinish(); -} - + TestFinish(); +} + void THttpHeaderParserTestSuite::TestRepeatedContentEncoding() { TestStart(); THttpHeader httpHeader; |