diff --git a/src/Microsoft.AspNetCore.WebUtilities/BufferedReadStream.cs b/src/Microsoft.AspNetCore.WebUtilities/BufferedReadStream.cs index a6c4106d80..b72920df4d 100644 --- a/src/Microsoft.AspNetCore.WebUtilities/BufferedReadStream.cs +++ b/src/Microsoft.AspNetCore.WebUtilities/BufferedReadStream.cs @@ -327,21 +327,12 @@ namespace Microsoft.AspNetCore.WebUtilities builder.WriteByte(b); _bufferOffset++; _bufferCount--; - if (b == CR) + if (b == LF && foundCR) { - foundCR = true; - } - else if (b == LF) - { - if (foundCR) - { - foundCRLF = true; - } - else - { - foundCR = false; - } + foundCRLF = true; + return; } + foundCR = b == CR; } private string DecodeLine(MemoryStream builder, bool foundCRLF)