@@ -1547,6 +1547,34 @@ mod tests {
1547
1547
}
1548
1548
}
1549
1549
1550
+ // A single byte which is part of a method is not invalid
1551
+ req ! {
1552
+ test_request_one_byte_method,
1553
+ b"G" , Ok ( Status :: Partial ) ,
1554
+ |_req| { }
1555
+ }
1556
+
1557
+ // A subset of a method is a partial method, not invalid
1558
+ req ! {
1559
+ test_request_partial_method,
1560
+ b"GE" , Ok ( Status :: Partial ) ,
1561
+ |_req| { }
1562
+ }
1563
+
1564
+ // A method, without the delimiting space, is a partial request
1565
+ req ! {
1566
+ test_request_method_no_delimiter,
1567
+ b"GET" , Ok ( Status :: Partial ) ,
1568
+ |_req| { }
1569
+ }
1570
+
1571
+ // Regression test: assert that a partial read with just the method and
1572
+ // space results in a partial, rather than a token error from uri parsing.
1573
+ req ! {
1574
+ test_request_method_only,
1575
+ b"GET " , Ok ( Status :: Partial ) ,
1576
+ |_req| { }
1577
+ }
1550
1578
1551
1579
req ! {
1552
1580
test_request_partial,
@@ -1560,6 +1588,18 @@ mod tests {
1560
1588
|_req| { }
1561
1589
}
1562
1590
1591
+ req ! {
1592
+ test_request_method_path_no_delimiter,
1593
+ b"GET /" , Ok ( Status :: Partial ) ,
1594
+ |_req| { }
1595
+ }
1596
+
1597
+ req ! {
1598
+ test_request_method_path_only,
1599
+ b"GET / " , Ok ( Status :: Partial ) ,
1600
+ |_req| { }
1601
+ }
1602
+
1563
1603
req ! {
1564
1604
test_request_partial_parses_headers_as_much_as_it_can,
1565
1605
b"GET / HTTP/1.1\r \n Host: yolo\r \n " ,
0 commit comments