File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -732,6 +732,12 @@ where
732732
733733 /// If the read side can be cheaply drained, do so. Otherwise, close.
734734 pub ( super ) fn poll_drain_or_close_read ( & mut self , cx : & mut task:: Context < ' _ > ) {
735+ if let Reading :: Continue ( ref decoder) = self . state . reading {
736+ // skip sending the 100-continue
737+ // just move forward to a read, in case a tiny body was included
738+ self . state . reading = Reading :: Body ( decoder. clone ( ) ) ;
739+ }
740+
735741 let _ = self . poll_read_body ( cx) ;
736742
737743 // If still in Reading::Body, just give up
Original file line number Diff line number Diff line change @@ -965,9 +965,8 @@ async fn expect_continue_waits_for_body_poll() {
965965 service_fn ( |req| {
966966 assert_eq ! ( req. headers( ) [ "expect" ] , "100-continue" ) ;
967967 // But! We're never going to poll the body!
968+ drop ( req) ;
968969 TokioTimer . sleep ( Duration :: from_millis ( 50 ) ) . map ( move |_| {
969- // Move and drop the req, so we don't auto-close
970- drop ( req) ;
971970 Response :: builder ( )
972971 . status ( StatusCode :: BAD_REQUEST )
973972 . body ( Empty :: < Bytes > :: new ( ) )
You can’t perform that action at this time.
0 commit comments