@@ -7,19 +7,16 @@ using namespace NMonitoring::NAudit;
7
7
8
8
namespace {
9
9
10
- struct TRequestHolder : public NHttp ::THttpIncomingRequest {
11
- TStringBuf Store (TString value) {
12
- return Storage.emplace_back (std::move (value));
13
- }
14
- private:
15
- TVector<TString> Storage;
16
- };
17
-
18
10
NHttp::THttpIncomingRequestPtr MakeRequest (TString method, TString url) {
19
- auto request = MakeIntrusive<TRequestHolder>();
20
- request->Method = request->Store (std::move (method));
21
- request->URL = request->Store (std::move (url));
22
- return std::move (request);
11
+ static TVector<TString> Storage;
12
+
13
+ auto request = MakeIntrusive<NHttp::THttpIncomingRequest>();
14
+ Storage.emplace_back (std::move (method));
15
+ request->Method = Storage.back ();
16
+ Storage.emplace_back (std::move (url));
17
+ request->URL = Storage.back ();
18
+
19
+ return request;
23
20
}
24
21
25
22
} // namespace
@@ -45,7 +42,7 @@ Y_UNIT_TEST_SUITE(TAuditTest) {
45
42
UNIT_ASSERT (!ctx.AuditableRequest (MakeRequest (" OPTIONS" , " /path" )));
46
43
}
47
44
48
- Y_UNIT_TEST (BlacklistedPathsAreNotAudited ) {
45
+ Y_UNIT_TEST (DeniedPathsAreNotAudited ) {
49
46
TAuditCtx ctx;
50
47
UNIT_ASSERT (!ctx.AuditableRequest (MakeRequest (" GET" , " /counters" )));
51
48
UNIT_ASSERT (!ctx.AuditableRequest (MakeRequest (" GET" , " /viewer/subpage" )));
0 commit comments