From bde446bcc08483707dc20a0bbf85ad70bc9d1496 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Thu, 12 Jan 2023 23:24:29 +0100 Subject: Test and fix IPv6 FCGI support --- tests/test-webserver.cpp | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test-webserver.cpp b/tests/test-webserver.cpp index 714cdf2..bd89aab 100644 --- a/tests/test-webserver.cpp +++ b/tests/test-webserver.cpp @@ -604,7 +604,7 @@ BOOST_FIXTURE_TEST_CASE(http_redirect, Fixture) BOOST_CHECK_EQUAL(result.second, "301 Redirecting to reichwein.it ..."); } -BOOST_FIXTURE_TEST_CASE(http_fcgi, Fixture) +BOOST_FIXTURE_TEST_CASE(http_fcgi_ip4, Fixture) { std::string webserver_config{R"CONFIG( www-data @@ -649,3 +649,48 @@ BOOST_FIXTURE_TEST_CASE(http_fcgi, Fixture) BOOST_CHECK_EQUAL(result.second, "returning data of : "); } +BOOST_FIXTURE_TEST_CASE(http_fcgi_ip6, Fixture) +{ + std::string webserver_config{R"CONFIG( + www-data + www-data + 10 + stats.db + ../plugins + + + localhost + localhost + [::1] + + fcgi + ::1:8765 + + + + + +
::1
+ 8080 + http + localhost +
+
+
)CONFIG"}; + WebserverProcess serverProcess{webserver_config}; + BOOST_REQUIRE(serverProcess.is_running()); + + FastCGIProcess fcgiProcess("./fcgi1", "::1", 8765); + BOOST_REQUIRE(fcgiProcess.is_running()); + + auto result {HTTP("/fcgi/abc")}; + BOOST_CHECK_EQUAL(result.first, fmt::format( +"HTTP/1.1 200 OK\r\n" +"Server: Reichwein.IT Webserver {}\r\n" +"Content-Type: text/plain\r\n" +"Content-Length: {}\r\n" +"\r\n" + , VERSION, result.second.size())); + BOOST_CHECK_EQUAL(result.second, "returning data of : "); +} + -- cgit v1.2.3