fixed http_connection redirection support and added test (still requires lighttp)

This commit is contained in:
Arvid Norberg
2008-01-12 01:41:56 +00:00
parent 388949014f
commit 81302c8fed
4 changed files with 46 additions and 39 deletions

View File

@@ -71,11 +71,13 @@ void start_web_server(int port)
{
stop_web_server(port);
std::ofstream f("./lighty_config");
f << "server.modules = (\"mod_access\")\n"
f << "server.modules = (\"mod_access\", \"mod_redirect\")\n"
"server.document-root = \"" << boost::filesystem::initial_path().string() << "\"\n"
"server.range-requests = \"enable\"\n"
"server.port = " << port << "\n"
"server.pid-file = \"./lighty" << port << ".pid\"\n";
"server.pid-file = \"./lighty" << port << ".pid\"\n"
"url.redirect = (\"^/redirect$\" => \"http://127.0.0.1:" << port << "/test_file\", "
"\"^/infinite_redirect$\" => \"http://127.0.0.1:" << port << "/infinite_redirect\")";
f.close();
system("lighttpd -f lighty_config &");