File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -748,6 +748,12 @@ where
748
748
749
749
/// If the read side can be cheaply drained, do so. Otherwise, close.
750
750
pub ( super ) fn poll_drain_or_close_read ( & mut self , cx : & mut task:: Context < ' _ > ) {
751
+ if let Reading :: Continue ( ref decoder) = self . state . reading {
752
+ // skip sending the 100-continue
753
+ // just move forward to a read, in case a tiny body was included
754
+ self . state . reading = Reading :: Body ( decoder. clone ( ) ) ;
755
+ }
756
+
751
757
let _ = self . poll_read_body ( cx) ;
752
758
753
759
// If still in Reading::Body, just give up
Original file line number Diff line number Diff line change @@ -973,9 +973,8 @@ async fn expect_continue_waits_for_body_poll() {
973
973
service_fn ( |req| {
974
974
assert_eq ! ( req. headers( ) [ "expect" ] , "100-continue" ) ;
975
975
// But! We're never going to poll the body!
976
+ drop ( req) ;
976
977
tokio:: time:: sleep ( Duration :: from_millis ( 50 ) ) . map ( move |_| {
977
- // Move and drop the req, so we don't auto-close
978
- drop ( req) ;
979
978
Response :: builder ( )
980
979
. status ( StatusCode :: BAD_REQUEST )
981
980
. body ( hyper:: Body :: empty ( ) )
You can’t perform that action at this time.
0 commit comments