diff options
author | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-04-21 02:29:21 +0300 |
---|---|---|
committer | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-04-21 02:29:21 +0300 |
commit | 29486e56aab0f6709271b5f3f61035d8224f5bb0 (patch) | |
tree | b4e0fc0d9c5548fe8b3d5fd89d3d823783bbd65b /library/cpp/http/server/http_ut.cpp | |
parent | 168b49d756bf779f776edbb2493bfb49f22d633c (diff) | |
download | ydb-29486e56aab0f6709271b5f3f61035d8224f5bb0.tar.gz |
intermediate changes
ref:f15213aec8036b5997a8dd8c73570eb4babaa6c2
Diffstat (limited to 'library/cpp/http/server/http_ut.cpp')
-rw-r--r-- | library/cpp/http/server/http_ut.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/library/cpp/http/server/http_ut.cpp b/library/cpp/http/server/http_ut.cpp index cc62bb988e..7fc918f74f 100644 --- a/library/cpp/http/server/http_ut.cpp +++ b/library/cpp/http/server/http_ut.cpp @@ -641,6 +641,39 @@ Y_UNIT_TEST_SUITE(THttpServerTest) { server.Stop(); } + Y_UNIT_TEST(TTestNullInRequest) { + TPortManager pm; + const ui16 port = pm.GetPort(); + + TEchoServer serverImpl("test_data"); + THttpServer::TOptions options(port); + options.nThreads = 1; + options.MaxQueueSize = 0; + options.MaxConnections = 0; + options.KeepAliveEnabled = false; + options.ExpirationTimeout = TDuration::Seconds(1); + options.PollTimeout = TDuration::MilliSeconds(100); + THttpServer server(&serverImpl, options); + UNIT_ASSERT(server.Start()); + + TSocket socket(TNetworkAddress("localhost", port), TDuration::Seconds(5)); + + + TSocketInput si(socket); + TSocketOutput so(socket); + THttpOutput out(&so); + out << "GET \0/ggg HTTP/1.1" << CrLf; + out << "Host: localhost:" + ToString(port) << CrLf; + out << CrLf; + out.Flush(); + + THttpInput input(&si); + input.ReadAll(); + + UNIT_ASSERT_STRING_CONTAINS(input.FirstLine(), "HTTP/1.1 4"); + server.Stop(); + } + Y_UNIT_TEST(TTestCloseConnectionOnRequestLimit) { TPortManager pm; |