React to runtime/594 Encoder.Convert change (#17747)

This commit is contained in:
Chris Ross 2020-01-15 11:07:50 -08:00 committed by Andrew Stanton-Nurse
parent 6ec28e8715
commit ad8ecf96a1
1 changed files with 2 additions and 1 deletions

View File

@ -133,7 +133,8 @@ namespace Microsoft.AspNetCore.Http
// Therefore, we check encodedLength - totalBytesUsed too.
while (!completed || encodedLength - totalBytesUsed != 0)
{
encoder.Convert(source, destination, flush: source.Length == 0, out var charsUsed, out var bytesUsed, out completed);
// 'text' is a complete string, the converter should always flush its buffer.
encoder.Convert(source, destination, flush: true, out var charsUsed, out var bytesUsed, out completed);
totalBytesUsed += bytesUsed;
writer.Advance(bytesUsed);