Option attribute values for HTML parser
[metaproxy-moved-to-github.git] / src / test_filter_rewrite.cpp
index 65cb4c0..7df4d0b 100644 (file)
@@ -68,7 +68,7 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_1 )
             "<?xml version='1.0'?>\n"
             "<filter xmlns='http://indexdata.com/metaproxy'\n"
             "        id='rewrite1' type='http_rewrite'>\n"
-            " <request>\n"
+            " <request verbose=\"1\">\n"
             "   <rule name=\"null\"/>\n"
             "   <rule name=\"url\">\n"
             "     <rewrite from='"
@@ -81,7 +81,7 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_1 )
             "  <within header=\"link\" rule=\"null\"/>\n"
             "  <within reqline=\"1\" rule=\"url\"/>\n"
             " </request>\n"
-            " <response>\n"
+            " <response verbose=\"1\">\n"
             "   <rule name=\"null\"/>\n"
             "   <rule name=\"url\">\n"
             "     <rewrite from='"
@@ -89,8 +89,9 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_1 )
             "            to='${proto}${pxhost}/${pxpath}/${host}/${path}' />\n"
             "  </rule>\n"
             "  <within header=\"link\" rule=\"url\"/>\n"
-            "  <within tag=\"script\" attr=\"src,#text\" rule=\"url\"/>\n"
-            "  <within tag=\"style\" rule=\"url\"/>\n"
+            "  <within tag=\"body\" attr=\"background\" rule=\"null\"/>\n"
+            "  <within tag=\"script\" attr=\"#text\" rule=\"url\"/>\n"
+            "  <within tag=\"style\" attr=\"#text\" rule=\"url\"/>\n"
             "  <within attr=\"href,src\" rule=\"url\"/>\n"
             " </response>\n"
             "</filter>\n"
@@ -145,7 +146,7 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_1 )
 
         const char *resp_expected =
             "HTTP/1.1 200 OK\r\n"
-            "Content-Length: 522\r\n"
+            "Content-Length: 520\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"
@@ -163,7 +164,7 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_1 )
             "xified"
             "<a href=\"http://proxyhost/proxypath/targetsite/page2.html\">"
             "  An absolute link</a>"
-            "<a target=\"_blank\" href=\"http://proxyhost/proxypath/targetsite/page3.html\">"
+            "<a target=_blank href=\"http://proxyhost/proxypath/targetsite/page3.html\">"
             "  Another abs link</a>"
             "<a href=\"/docs/page4.html\"/>"
             "</body></html>";