This repository was archived by the owner on Mar 19, 2019. It is now read-only.
File tree 2 files changed +4
-3
lines changed
src/Microsoft.Net.Http.Server/RequestProcessing
test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -453,14 +453,14 @@ internal HttpApi.HTTP_FLAGS ComputeHeaders(long writeCount, bool endOfRequest =
453
453
_boundaryType = BoundaryType . ContentLength ;
454
454
_expectedBodyLength = 0 ;
455
455
}
456
- else if ( keepConnectionAlive && requestVersion == Constants . V1_1 )
456
+ else if ( requestVersion == Constants . V1_1 )
457
457
{
458
458
_boundaryType = BoundaryType . Chunked ;
459
459
Headers [ HttpKnownHeaderNames . TransferEncoding ] = Constants . Chunked ;
460
460
}
461
461
else
462
462
{
463
- // The length cannot be determined, so we must close the connection
463
+ // v1.0 and the length cannot be determined, so we must close the connection after writing data
464
464
keepConnectionAlive = false ;
465
465
_boundaryType = BoundaryType . Close ;
466
466
}
Original file line number Diff line number Diff line change @@ -133,7 +133,8 @@ public async Task ResponseHeaders_ServerSendsConnectionClose_Closed()
133
133
response . EnsureSuccessStatusCode ( ) ;
134
134
Assert . True ( response . Headers . ConnectionClose . Value ) ;
135
135
Assert . Equal ( new string [ ] { "close" } , response . Headers . GetValues ( "Connection" ) ) ;
136
- Assert . False ( response . Headers . TransferEncodingChunked . HasValue ) ;
136
+ Assert . True ( response . Headers . TransferEncodingChunked . HasValue ) ;
137
+ Assert . True ( response . Headers . TransferEncodingChunked ) ;
137
138
IEnumerable < string > values ;
138
139
var result = response . Content . Headers . TryGetValues ( "Content-Length" , out values ) ;
139
140
Assert . False ( result ) ;
You can’t perform that action at this time.
0 commit comments