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 | d331afa299a67de4e1afaf388f4edd5584a3c92f (patch) | |
tree | 35e53cf9b47fac5c3cb6f2bf6c7195eb1e41ee0a /library/cpp/http | |
parent | e01af096d5cd7baca583319f1473a2a2c993ec86 (diff) | |
download | ydb-d331afa299a67de4e1afaf388f4edd5584a3c92f.tar.gz |
Restoring authorship annotation for <vlid@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/http')
-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 eab0328b18..68ba819f33 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 b018e80101..ba5a011e0b 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; |