fixed error handling and added support for relative http redirects (which aren't allowed by the standard)
This commit is contained in:
@@ -97,10 +97,11 @@ void start_web_server(int port, bool ssl)
|
||||
"server.range-requests = \"enable\"\n"
|
||||
"server.port = " << port << "\n"
|
||||
"server.pid-file = \"./lighty" << port << ".pid\"\n"
|
||||
"url.redirect = (\"^/redirect$\" => \""
|
||||
<< (ssl?"https":"http") << "://127.0.0.1:" << port << "/test_file\", "
|
||||
"\"^/infinite_redirect$\" => \""
|
||||
<< (ssl?"https":"http") << "://127.0.0.1:" << port << "/infinite_redirect\")\n"
|
||||
"url.redirect = ("
|
||||
"\"^/redirect$\" => \"" << (ssl?"https":"http") << "://127.0.0.1:" << port << "/test_file\""
|
||||
", \"^/infinite_redirect$\" => \"" << (ssl?"https":"http") << "://127.0.0.1:" << port << "/infinite_redirect\""
|
||||
", \"^/relative/redirect$\" => \"../test_file\""
|
||||
")\n"
|
||||
"$HTTP[\"url\"] == \"/test_file.gz\" {\n"
|
||||
" setenv.add-response-header = ( \"Content-Encoding\" => \"gzip\" )\n"
|
||||
"# mimetype.assign = ()\n"
|
||||
|
@@ -104,6 +104,7 @@ void run_suite(std::string const& protocol, proxy_settings const& ps)
|
||||
<< " proxy **********************\n" << std::endl;
|
||||
|
||||
typedef boost::optional<error_code> err;
|
||||
run_test(protocol + "://127.0.0.1:8001/relative/redirect", 3216, 200, 2, error_code(), ps);
|
||||
run_test(protocol + "://127.0.0.1:8001/redirect", 3216, 200, 2, error_code(), ps);
|
||||
run_test(protocol + "://127.0.0.1:8001/infinite_redirect", 0, 301, 6, error_code(), ps);
|
||||
run_test(protocol + "://127.0.0.1:8001/test_file", 3216, 200, 1, error_code(), ps);
|
||||
|
Reference in New Issue
Block a user