Browse Source

Add HTTP/2 Connection Preface check test

yhirose 6 years ago
parent
commit
a99e02aeb3
1 changed files with 12 additions and 0 deletions
  1. 12 0
      test/test.cc

+ 12 - 0
test/test.cc

@@ -1393,6 +1393,18 @@ TEST_F(ServerTest, NoMultipleHeaders) {
   EXPECT_EQ(200, res->status);
 }
 
+TEST_F(ServerTest, HTTP2Magic) {
+  Request req;
+  req.method = "PRI";
+  req.path = "/";
+  req.body = "SM";
+
+  auto res = std::make_shared<Response>();
+  auto ret = cli_.send(req, *res);
+
+  ASSERT_TRUE(ret);
+  EXPECT_EQ(400, res->status);
+}
 TEST_F(ServerTest, KeepAlive) {
   cli_.set_keep_alive_max_count(4);