@@ -2323,6 +2323,41 @@ TEST_F(ServerTest, PostMulitpartFilsContentReceiver) {
23232323  EXPECT_EQ (200 , res->status );
23242324}
23252325
2326+ TEST_F (ServerTest, PostMulitpartPlusBoundary) {
2327+   MultipartFormDataItems items = {
2328+       {" text1" " text default" " " " " 
2329+       {" text2" " aωb" " " " " 
2330+       {" file1" " h\n e\n\n l\n l\n o\n " " hello.txt" " text/plain" 
2331+       {" file2" " {\n   \" world\" , true\n }\n " " world.json" " application/json" 
2332+       {" file3" " " " " " application/octet-stream" 
2333+   };
2334+ 
2335+   auto  boundary = std::string (" +++++" 
2336+ 
2337+   std::string body;
2338+ 
2339+   for  (const  auto  &item : items) {
2340+     body += " --" " \r\n " 
2341+     body += " Content-Disposition: form-data; name=\" " name  + " \" " 
2342+     if  (!item.filename .empty ()) {
2343+       body += " ; filename=\" " filename  + " \" " 
2344+     }
2345+     body += " \r\n " 
2346+     if  (!item.content_type .empty ()) {
2347+       body += " Content-Type: " content_type  + " \r\n " 
2348+     }
2349+     body += " \r\n " 
2350+     body += item.content  + " \r\n " 
2351+   }
2352+   body += " --" " --\r\n " 
2353+ 
2354+   std::string content_type = " multipart/form-data; boundary=" 
2355+   auto  res = cli_.Post (" /content_receiver" c_str ());
2356+ 
2357+   ASSERT_TRUE (res);
2358+   EXPECT_EQ (200 , res->status );
2359+ }
2360+ 
23262361TEST_F (ServerTest, PostContentReceiverGzip) {
23272362  cli_.set_compress (true );
23282363  auto  res = cli_.Post (" /content_receiver" " content" " text/plain" 
0 commit comments