{
try
{
- std::cout << "Running non-xml config test case" << std::endl;
mp::RouterChain router;
mp::filter::HttpRewrite fhr;
" </request>\n"
" <response verbose=\"1\">\n"
" <rule name=\"null\"/>\n"
+ " <rule name=\"cx\">\n"
+ " <rewrite from='^cx' to='cy'/>\n"
+ " </rule>\n"
" <rule name=\"url\">\n"
" <rewrite from='foo' to='bar'/>\n"
- " <rewrite from='^cx' to='cy'/>\n"
" <rewrite from='"
"(?<proto>https?://)(?<host>[^/?# "'>]+)/(?<path>[^ "'>]+)'\n"
" to='${proto}${pxhost}/${pxpath}/${host}/${path}' />\n"
" <within tag=\"body\" attr=\"background\" rule=\"null\"/>\n"
" <within tag=\"script\" attr=\"#text\" type=\"quoted-literal\" rule=\"url\"/>\n"
" <within tag=\"style\" attr=\"#text\" rule=\"url\"/>\n"
- " <within attr=\"href|src\" rule=\"url\"/>\n"
+ " <within attr=\"href|src\" rule=\"url,cx\"/>\n"
" <within attr=\"onclick\" type=\"quoted-literal\" rule=\"url\"/>\n"
" </content>\n"
" <content type=\"quoted-literal\" mime=\".*javascript\">\n"
"</style>"
"</head>"
"<script>var jslink=\"http://targetsite/webservice.xml\";"
+ "for (i = 0; i<foo; i++) ;\n"
"var some=\"foo\"; foo=1;"
"</script>"
"<body>"
const char *resp_expected =
"HTTP/1.1 200 OK\r\n"
- "Content-Length: 605\r\n"
+ "Content-Length: 631\r\n"
"Content-Type: text/html\r\n"
"Link: <http://proxyhost/proxypath/targetsite/file.xml>; rel=absolute\r\n"
"Link: </dir/file.xml>; rel=relative\r\n"
"</style>"
"</head>"
"<script>var jslink=\"http://proxyhost/proxypath/targetsite/webservice.xml\";"
+ "for (i = 0; i<foo; i++) ;\n"
"var some=\"bar\"; foo=1;"
"</script>"
"<body>"
{
//compare buffers
std::cout << "Expected result:\n" << resp_expected << "\n";
- std::cout << "Got result:\n" << "\n";
+ std::cout << "Got result:\n";
fflush(stdout);
fwrite(resp_result, 1, resp_result_len, stdout);
fflush(stdout);
}
}
-
BOOST_AUTO_TEST_CASE( test_filter_rewrite_2 )
{
try
{
- std::cout << "Running non-xml config test case" << std::endl;
mp::RouterChain router;
mp::filter::HttpRewrite fhr;
{
//compare buffers
std::cout << "Expected result:\n" << resp_expected << "\n";
- std::cout << "Got result:\n" << "\n";
+ std::cout << "Got result:\n";
fflush(stdout);
fwrite(resp_result, 1, resp_result_len, stdout);
fflush(stdout);