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 @@ -172,13 +172,15 @@ protected void AddAndCheckObservedBytes(long observedBytes)
172
172
173
173
protected ValueTask < ReadResult > StartTimingReadAsync ( ValueTask < ReadResult > readAwaitable , CancellationToken cancellationToken )
174
174
{
175
-
176
- if ( ! readAwaitable . IsCompleted && _timingEnabled )
175
+ if ( ! readAwaitable . IsCompleted )
177
176
{
178
177
TryProduceContinue ( ) ;
179
178
180
- _backpressure = true ;
181
- _context . TimeoutControl . StartTimingRead ( ) ;
179
+ if ( _timingEnabled )
180
+ {
181
+ _backpressure = true ;
182
+ _context . TimeoutControl . StartTimingRead ( ) ;
183
+ }
182
184
}
183
185
184
186
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