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 @@ -732,6 +732,12 @@ where
732
732
733
733
/// If the read side can be cheaply drained, do so. Otherwise, close.
734
734
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
+
735
741
let _ = self . poll_read_body ( cx) ;
736
742
737
743
// 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() {
965
965
service_fn ( |req| {
966
966
assert_eq ! ( req. headers( ) [ "expect" ] , "100-continue" ) ;
967
967
// But! We're never going to poll the body!
968
+ drop ( req) ;
968
969
TokioTimer . sleep ( Duration :: from_millis ( 50 ) ) . map ( move |_| {
969
- // Move and drop the req, so we don't auto-close
970
- drop ( req) ;
971
970
Response :: builder ( )
972
971
. status ( StatusCode :: BAD_REQUEST )
973
972
. body ( Empty :: < Bytes > :: new ( ) )
You can’t perform that action at this time.
0 commit comments