diff options
author | Alexey Efimov <[email protected]> | 2022-05-17 11:34:57 +0300 |
---|---|---|
committer | Alexey Efimov <[email protected]> | 2022-05-17 11:34:57 +0300 |
commit | 742718e4953ed9e9f897f5194871fc7cec65caa3 (patch) | |
tree | 6501c24969779138b433d19606a22791742e38b9 /library/cpp/actors | |
parent | 1e1dfc1b3545147948cc2190bb15161f630507e9 (diff) |
add http-mon via ic proxy KIKIMR-14742
ref:b3a758f33f4578f7f8ce2e822783faf41a5ab6cd
Diffstat (limited to 'library/cpp/actors')
-rw-r--r-- | library/cpp/actors/http/http.h | 11 | ||||
-rw-r--r-- | library/cpp/actors/http/http_ut.cpp | 3 |
2 files changed, 12 insertions, 2 deletions
diff --git a/library/cpp/actors/http/http.h b/library/cpp/actors/http/http.h index 54ed5d6d8fb..38e616cafa2 100644 --- a/library/cpp/actors/http/http.h +++ b/library/cpp/actors/http/http.h @@ -116,6 +116,11 @@ public: } return true; } + + // non-destructive variant of AsString + TString AsString() const { + return TString(Data(), Size()); + } }; class THttpRequest { @@ -674,6 +679,12 @@ public: , Address(address) {} + THttpIncomingRequest(TStringBuf content, std::shared_ptr<THttpEndpointInfo> endpoint, const THttpConfig::SocketAddressType& address) + : THttpParser(content) + , Endpoint(std::move(endpoint)) + , Address(address) + {} + bool IsConnectionClose() const { if (Connection.empty()) { return Version == "1.0"; diff --git a/library/cpp/actors/http/http_ut.cpp b/library/cpp/actors/http/http_ut.cpp index 4ec7761da91..e87de6b6e15 100644 --- a/library/cpp/actors/http/http_ut.cpp +++ b/library/cpp/actors/http/http_ut.cpp @@ -182,8 +182,7 @@ Y_UNIT_TEST_SUITE(HttpProxy) { cookies.Set("cookie2", "45678"); headers.Set("Cookie", cookies.Render()); request->Set(headers); - TString requestData; - request->AsString(requestData); + TString requestData = request->AsString(); UNIT_ASSERT_VALUES_EQUAL(requestData, "GET /data/url HTTP/1.1\r\nHost: www.yandex.ru\r\nAccept: */*\r\nCookie: cookie1=123456; cookie2=45678;\r\n"); } |