damianh / LimitsMiddleware

OWIN middleware to apply limits to an OWIN pipeline.
MIT License
0 stars 0 forks source link

Bug in limited stream #30

Open diaconesq opened 6 years ago

diaconesq commented 6 years ago

This line:

int currentNumberOfBytesRead = _innerStream.ReadByte();

ReadByte returns the value of the next byte in the stream, not the number of read bytes.

https://docs.microsoft.com/en-gb/dotnet/api/system.io.stream.readbyte?view=netframework-4.7.1#System_IO_Stream_ReadByte