File tree Expand file tree Collapse file tree 2 files changed +42
-4
lines changed
test/InMemory.FunctionalTests Expand file tree Collapse file tree 2 files changed +42
-4
lines changed Original file line number Diff line number Diff line change @@ -154,13 +154,15 @@ protected void AddAndCheckConsumedBytes(long consumedBytes)
154154
155155 protected ValueTask < ReadResult > StartTimingReadAsync ( ValueTask < ReadResult > readAwaitable , CancellationToken cancellationToken )
156156 {
157-
158- if ( ! readAwaitable . IsCompleted && _timingEnabled )
157+ if ( ! readAwaitable . IsCompleted )
159158 {
160159 TryProduceContinue ( ) ;
161160
162- _backpressure = true ;
163- _context . TimeoutControl . StartTimingRead ( ) ;
161+ if ( _timingEnabled )
162+ {
163+ _backpressure = true ;
164+ _context . TimeoutControl . StartTimingRead ( ) ;
165+ }
164166 }
165167
166168 return readAwaitable ;
Original file line number Diff line number Diff line change @@ -590,6 +590,42 @@ await connection.ReceiveEnd(
590590 }
591591 }
592592
593+ [ Fact ]
594+ public async Task Expect100ContinueHonoredWhenMinRequestBodyDataRateIsDisabled ( )
595+ {
596+ var testContext = new TestServiceContext ( LoggerFactory ) ;
597+
598+ // This may seem unrelated, but this is a regression test for
599+ // https://github.com/dotnet/aspnetcore/issues/30449
600+ testContext . ServerOptions . Limits . MinRequestBodyDataRate = null ;
601+
602+ await using ( var server = new TestServer ( TestApp . EchoAppChunked , testContext ) )
603+ {
604+ using ( var connection = server . CreateConnection ( ) )
605+ {
606+ await connection . Send (
607+ "POST / HTTP/1.1" ,
608+ "Host:" ,
609+ "Expect: 100-continue" ,
610+ "Connection: close" ,
611+ "Content-Length: 11" ,
612+ "\r \n " ) ;
613+ await connection . Receive (
614+ "HTTP/1.1 100 Continue" ,
615+ "" ,
616+ "" ) ;
617+ await connection . Send ( "Hello World" ) ;
618+ await connection . ReceiveEnd (
619+ "HTTP/1.1 200 OK" ,
620+ "Connection: close" ,
621+ $ "Date: { testContext . DateHeaderValue } ",
622+ "Content-Length: 11" ,
623+ "" ,
624+ "Hello World" ) ;
625+ }
626+ }
627+ }
628+
593629 [ Fact ]
594630 public async Task ZeroContentLengthAssumedOnNonKeepAliveRequestsWithoutContentLengthOrTransferEncodingHeader ( )
595631 {
You can’t perform that action at this time.
0 commit comments