http_rewrite: parsing of new configuration
[metaproxy-moved-to-github.git] / src / test_filter_rewrite.cpp
index e3802a7..36e1a15 100644 (file)
@@ -69,17 +69,23 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_1 )
             "<filter xmlns='http://indexdata.com/metaproxy'\n"
             "        id='rewrite1' type='http_rewrite'>\n"
             " <request>\n"
-            "   <rewrite from='"
+            "   <rule name=\"url\">\n"
+            "     <rewrite from='"
     "(?&lt;proto>https?://)(?&lt;pxhost>[^ /?#]+)/(?&lt;pxpath>[^ /]+)"
     "/(?&lt;host>[^ /]+)(?&lt;path>[^ ]*)'\n"
             "            to='${proto}${host}${path}' />\n"
-            "   <rewrite from='(?:Host: )(.*)'\n"
-            "            to='Host: ${host}' />\n" 
+            "     <rewrite from='(?:Host: )(.*)'\n"
+            "            to='Host: ${host}' />\n"
+            "   </rule>\n"
+            "   <within rule=\"url\"/>\n"
             " </request>\n"
             " <response>\n"
-            "   <rewrite from='"
+            "   <rule name=\"url\">\n"
+            "     <rewrite from='"
     "(?&lt;proto>https?://)(?&lt;host>[^/?# &quot;&apos;>]+)/(?&lt;path>[^  &quot;&apos;>]+)'\n"
             "            to='${proto}${pxhost}/${pxpath}/${host}/${path}' />\n" 
+            "  </rule>\n"
+            "  <within rule=\"url\"/>\n"
             " </response>\n"
             "</filter>\n"
         ;