]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Add a few testcases for "incomplete" URLs
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 26 Jul 2023 07:35:05 +0000 (09:35 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 22 Aug 2023 13:58:04 +0000 (15:58 +0200)
(cherry picked from commit 7ab40a80547d112914b71919d8f4aa14cc24b047)

pdns/test-webserver_cc.cc

index 785330f93282cc5be76d6f88e34e45c887c04520..5003dbb220c6eadf34cbaefba2c6fcf8bca25b7e 100644 (file)
@@ -18,10 +18,16 @@ BOOST_AUTO_TEST_CASE(test_validURL)
     {"http://www.powerdns.com/\x7f?foo=123", false},
     {"http://www.powerdns.com/\x80?foo=123", false},
     {"http://www.powerdns.com/?\xff", false},
+    {"/?foo=123&bar", true},
+    {"/?foo=%ff&bar", true},
+    {"/?\x01foo=123", false},
+    {"/?foo=123\x01", false},
+    {"/\x7f?foo=123", false},
+    {"/\x80?foo=123", false},
+    {"/?\xff", false},
   };
 
   for (const auto& testcase : urls) {
-    cerr << testcase.first << endl;
     BOOST_CHECK_EQUAL(WebServer::validURL(testcase.first), testcase.second);
   }
 }