Bug #8577 » 0001-Fix-a-couple-of-trusted-proxy-tests.patch
test/http/HttpClientServerTest.C | ||
---|---|---|
{
|
||
Server server;
|
||
server.resource().clientAddressTest();
|
||
server.configuration().setBehindReverseProxy(true);
|
||
server.configuration().setTrustedProxies({
|
||
Configuration::Network::fromString("127.0.0.1")
|
||
});
|
||
if (server.start()) {
|
||
Client client;
|
||
... | ... | |
{
|
||
Server server;
|
||
server.resource().clientAddressTest();
|
||
server.configuration().setBehindReverseProxy(true);
|
||
server.configuration().setOriginalIPHeader("Client-IP");
|
||
if (server.start()) {
|
||
... | ... | |
BOOST_REQUIRE(!client.err());
|
||
BOOST_REQUIRE(client.message().status() == 200);
|
||
// Should get IP address from X-Forwarded-For
|
||
// Should get IP address from Client-IP
|
||
BOOST_REQUIRE(client.message().body() == "203.0.113.1");
|
||
}
|
||
}
|
- « Previous
- 1
- 2
- Next »