mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-18 18:55:51 +00:00
feat: Proxy support (#2490)
Add client IP resolving support in case when there is a proxy in front of Clio.
This commit is contained in:
@@ -92,6 +92,21 @@ TEST_F(OnConnectCheckTests, RateLimited)
|
||||
EXPECT_EQ(httpResponse.body(), "Too many requests");
|
||||
}
|
||||
|
||||
struct IpChangeHookTests : WebHandlersTest {
|
||||
IpChangeHook ipChangeHook{dosGuardMock};
|
||||
};
|
||||
|
||||
TEST_F(IpChangeHookTests, CallsDecrementAndIncrement)
|
||||
{
|
||||
std::string const oldIp = "old ip";
|
||||
std::string const newIp = "new ip";
|
||||
|
||||
EXPECT_CALL(dosGuardMock, decrement(oldIp));
|
||||
EXPECT_CALL(dosGuardMock, increment(newIp));
|
||||
|
||||
ipChangeHook(oldIp, newIp);
|
||||
}
|
||||
|
||||
struct DisconnectHookTests : WebHandlersTest {
|
||||
DisconnectHook disconnectHook{dosGuardMock};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user