Project

General

Profile

Bug #8577 » 0001-Fix-a-couple-of-trusted-proxy-tests.patch

Bruce Toll, 05/24/2021 09:09 PM

View differences:

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");
}
}
(2-2/2)