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 @@ -172,13 +172,15 @@ protected void AddAndCheckObservedBytes(long observedBytes)
172172
173173 protected ValueTask < ReadResult > StartTimingReadAsync ( ValueTask < ReadResult > readAwaitable , CancellationToken cancellationToken )
174174 {
175-
176- if ( ! readAwaitable . IsCompleted && _timingEnabled )
175+ if ( ! readAwaitable . IsCompleted )
177176 {
178177 TryProduceContinue ( ) ;
179178
180- _backpressure = true ;
181- _context . TimeoutControl . StartTimingRead ( ) ;
179+ if ( _timingEnabled )
180+ {
181+ _backpressure = true ;
182+ _context . TimeoutControl . StartTimingRead ( ) ;
183+ }
182184 }
183185
184186 return readAwaitable ;
Original file line number Diff line number Diff line change @@ -846,6 +846,42 @@ await connection.ReceiveEnd(
846846 }
847847 }
848848
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+
849885 [ Fact ]
850886 public async Task ZeroContentLengthAssumedOnNonKeepAliveRequestsWithoutContentLengthOrTransferEncodingHeader ( )
851887 {
You can’t perform that action at this time.
0 commit comments