diff options
author | Daniil Cherednik <dan.cherednik@gmail.com> | 2022-10-11 17:07:02 +0300 |
---|---|---|
committer | Daniil Cherednik <dan.cherednik@gmail.com> | 2022-10-11 17:07:02 +0300 |
commit | 0b931ad6e6868bca7e7ec4617999c0d6befd7003 (patch) | |
tree | c10d4fcf9f5a638745e9c2b725852f03e5a175ce /library/cpp/actors/http/http_ut.cpp | |
parent | e6c9b17192c56494adba359d5e132c431b241191 (diff) | |
download | ydb-0b931ad6e6868bca7e7ec4617999c0d6befd7003.tar.gz |
Ydb stable 22-4-3022.4.30
x-stable-origin-commit: a5971297427891237b5f05b5389146b6ca2fff93
Diffstat (limited to 'library/cpp/actors/http/http_ut.cpp')
-rw-r--r-- | library/cpp/actors/http/http_ut.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/library/cpp/actors/http/http_ut.cpp b/library/cpp/actors/http/http_ut.cpp index d7d4f5567f..90efd09015 100644 --- a/library/cpp/actors/http/http_ut.cpp +++ b/library/cpp/actors/http/http_ut.cpp @@ -139,6 +139,18 @@ Y_UNIT_TEST_SUITE(HttpProxy) { UNIT_ASSERT_EQUAL(response->Body, "this is test."); } + Y_UNIT_TEST(BasicParsingContentLength0) { + NHttp::THttpIncomingRequestPtr request = new NHttp::THttpIncomingRequest(); + EatPartialString(request, "GET /test HTTP/1.1\r\nHost: test\r\nContent-Length: 0\r\n\r\n"); + UNIT_ASSERT_EQUAL(request->Stage, NHttp::THttpIncomingRequest::EParseStage::Done); + UNIT_ASSERT_EQUAL(request->Method, "GET"); + UNIT_ASSERT_EQUAL(request->URL, "/test"); + UNIT_ASSERT_EQUAL(request->Protocol, "HTTP"); + UNIT_ASSERT_EQUAL(request->Version, "1.1"); + UNIT_ASSERT_EQUAL(request->Host, "test"); + UNIT_ASSERT_EQUAL(request->Headers, "Host: test\r\nContent-Length: 0\r\n\r\n"); + } + Y_UNIT_TEST(AdvancedParsing) { NHttp::THttpIncomingRequestPtr request = new NHttp::THttpIncomingRequest(); EatWholeString(request, "GE"); |