File tree 2 files changed +42
-4
lines changed
test/InMemory.FunctionalTests
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)
154
154
155
155
protected ValueTask < ReadResult > StartTimingReadAsync ( ValueTask < ReadResult > readAwaitable , CancellationToken cancellationToken )
156
156
{
157
-
158
- if ( ! readAwaitable . IsCompleted && _timingEnabled )
157
+ if ( ! readAwaitable . IsCompleted )
159
158
{
160
159
TryProduceContinue ( ) ;
161
160
162
- _backpressure = true ;
163
- _context . TimeoutControl . StartTimingRead ( ) ;
161
+ if ( _timingEnabled )
162
+ {
163
+ _backpressure = true ;
164
+ _context . TimeoutControl . StartTimingRead ( ) ;
165
+ }
164
166
}
165
167
166
168
return readAwaitable ;
Original file line number Diff line number Diff line change @@ -590,6 +590,42 @@ await connection.ReceiveEnd(
590
590
}
591
591
}
592
592
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
+
593
629
[ Fact ]
594
630
public async Task ZeroContentLengthAssumedOnNonKeepAliveRequestsWithoutContentLengthOrTransferEncodingHeader ( )
595
631
{
You can’t perform that action at this time.
0 commit comments