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 @@ -181,13 +181,15 @@ protected void AddAndCheckObservedBytes(long observedBytes)
181
181
182
182
protected ValueTask < ReadResult > StartTimingReadAsync ( ValueTask < ReadResult > readAwaitable , CancellationToken cancellationToken )
183
183
{
184
-
185
- if ( ! readAwaitable . IsCompleted && _timingEnabled )
184
+ if ( ! readAwaitable . IsCompleted )
186
185
{
187
186
TryProduceContinue ( ) ;
188
187
189
- _backpressure = true ;
190
- _context . TimeoutControl . StartTimingRead ( ) ;
188
+ if ( _timingEnabled )
189
+ {
190
+ _backpressure = true ;
191
+ _context . TimeoutControl . StartTimingRead ( ) ;
192
+ }
191
193
}
192
194
193
195
return readAwaitable ;
Original file line number Diff line number Diff line change @@ -846,6 +846,42 @@ await connection.ReceiveEnd(
846
846
}
847
847
}
848
848
849
+ [ Fact ]
850
+ public async Task Expect100ContinueHonoredWhenMinRequestBodyDataRateIsDisabled ( )
851
+ {
852
+ var testContext = new TestServiceContext ( LoggerFactory ) ;
853
+
854
+ // This may seem unrelated, but this is a regression test for
855
+ // https://github.com/dotnet/aspnetcore/issues/30449
856
+ testContext . ServerOptions . Limits . MinRequestBodyDataRate = null ;
857
+
858
+ await using ( var server = new TestServer ( TestApp . EchoAppChunked , testContext ) )
859
+ {
860
+ using ( var connection = server . CreateConnection ( ) )
861
+ {
862
+ await connection . Send (
863
+ "POST / HTTP/1.1" ,
864
+ "Host:" ,
865
+ "Expect: 100-continue" ,
866
+ "Connection: close" ,
867
+ "Content-Length: 11" ,
868
+ "\r \n " ) ;
869
+ await connection . Receive (
870
+ "HTTP/1.1 100 Continue" ,
871
+ "" ,
872
+ "" ) ;
873
+ await connection . Send ( "Hello World" ) ;
874
+ await connection . ReceiveEnd (
875
+ "HTTP/1.1 200 OK" ,
876
+ "Connection: close" ,
877
+ $ "Date: { testContext . DateHeaderValue } ",
878
+ "Content-Length: 11" ,
879
+ "" ,
880
+ "Hello World" ) ;
881
+ }
882
+ }
883
+ }
884
+
849
885
[ Fact ]
850
886
public async Task ZeroContentLengthAssumedOnNonKeepAliveRequestsWithoutContentLengthOrTransferEncodingHeader ( )
851
887
{
You can’t perform that action at this time.
0 commit comments