diff options
author | Alexey Efimov <xeno@prnwatch.com> | 2022-05-04 10:13:58 +0300 |
---|---|---|
committer | Alexey Efimov <xeno@prnwatch.com> | 2022-05-04 10:13:58 +0300 |
commit | 6faf680f58ba8341a694dcbadf572d37197ae888 (patch) | |
tree | e5fd053607e59e6db7bdec1ea100f46e149a6f97 /library/cpp/actors/http/http_ut.cpp | |
parent | b4c4f96bf4475170a9ac5e4568cc7b05789986c8 (diff) | |
download | ydb-6faf680f58ba8341a694dcbadf572d37197ae888.tar.gz |
add async monitoring http KIKIMR-14742
ref:c51d608f0ae78f08597b88f837491da33a953ef6
Diffstat (limited to 'library/cpp/actors/http/http_ut.cpp')
-rw-r--r-- | library/cpp/actors/http/http_ut.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/library/cpp/actors/http/http_ut.cpp b/library/cpp/actors/http/http_ut.cpp index caa5b3e183..cdb9025ff1 100644 --- a/library/cpp/actors/http/http_ut.cpp +++ b/library/cpp/actors/http/http_ut.cpp @@ -50,7 +50,20 @@ Y_UNIT_TEST_SUITE(HttpProxy) { UNIT_ASSERT_EQUAL(request->Headers, "Host: test\r\nSome-Header: 32344\r\n\r\n"); } - Y_UNIT_TEST(BasicParsingChunkedBody) { + Y_UNIT_TEST(BasicParsingChunkedBodyRequest) { + NHttp::THttpIncomingRequestPtr request = new NHttp::THttpIncomingRequest(); + EatWholeString(request, "POST /Url HTTP/1.1\r\nConnection: close\r\nTransfer-Encoding: chunked\r\n\r\n4\r\nthis\r\n4\r\n is \r\n5\r\ntest.\r\n0\r\n\r\n"); + UNIT_ASSERT_EQUAL(request->Stage, NHttp::THttpIncomingRequest::EParseStage::Done); + UNIT_ASSERT_EQUAL(request->Method, "POST"); + UNIT_ASSERT_EQUAL(request->URL, "/Url"); + UNIT_ASSERT_EQUAL(request->Connection, "close"); + UNIT_ASSERT_EQUAL(request->Protocol, "HTTP"); + UNIT_ASSERT_EQUAL(request->Version, "1.1"); + UNIT_ASSERT_EQUAL(request->TransferEncoding, "chunked"); + UNIT_ASSERT_EQUAL(request->Body, "this is test."); + } + + Y_UNIT_TEST(BasicParsingChunkedBodyResponse) { NHttp::THttpOutgoingRequestPtr request = nullptr; //new NHttp::THttpOutgoingRequest(); NHttp::THttpIncomingResponsePtr response = new NHttp::THttpIncomingResponse(request); EatWholeString(response, "HTTP/1.1 200 OK\r\nConnection: close\r\nTransfer-Encoding: chunked\r\n\r\n4\r\nthis\r\n4\r\n is \r\n5\r\ntest.\r\n0\r\n\r\n"); @@ -83,7 +96,7 @@ Y_UNIT_TEST_SUITE(HttpProxy) { UNIT_ASSERT_EQUAL(response->Body, "this\r\n is test."); } - Y_UNIT_TEST(CreateRepsonseWithCompressedBody) { + Y_UNIT_TEST(CreateResponseWithCompressedBody) { NHttp::THttpIncomingRequestPtr request = nullptr; NHttp::THttpOutgoingResponsePtr response = new NHttp::THttpOutgoingResponse(request, "HTTP", "1.1", "200", "OK"); response->Set<&NHttp::THttpResponse::ContentEncoding>("gzip"); |