Update tests to have a regression suite
@@ -771,11 +771,10 @@ public class BodyHandlerTest extends WebTestBase {
}
@Test
- @Ignore("The latest netty decoder allows empty parameters, while before it would fail")
- public void testWeirdRequestForm() throws Exception {
+ public void testFomWithoutParamNameRequestForm() throws Exception {
router.clear();
router.route().handler(BodyHandler.create());
- Buffer buffer = Buffer.buffer("a=b&&c=d");
+ Buffer buffer = Buffer.buffer("a=b&=&c=d");
router.route().handler(rc -> fail("Should not be called"));
testRequest(HttpMethod.POST, "/", req -> {
req.setChunked(true);
@@ -784,6 +783,19 @@ public class BodyHandlerTest extends WebTestBase {
}, 400, "Bad Request", null);
}
+ @Test
+ public void testFomWithoutParamRequestForm() throws Exception {
+ router.clear();
+ router.route().handler(BodyHandler.create());
+ Buffer buffer = Buffer.buffer("a=b&&c=d");
+ router.route().handler(RoutingContext::end);
+ testRequest(HttpMethod.POST, "/", req -> {
+ req.setChunked(true);
+ req.putHeader("content-type", "application/x-www-form-urlencoded");
+ req.write(buffer);
+ }, 200, "OK", null);
+ }
+
@Test
public void testJsonLimit() throws Exception {
router.clear();
