stream-utils / raw-body

Get and validate the raw body of a readable stream

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

expecting a buffer stream

Raynos opened this issue · comments

You throw an expected a buffer stream error if an encoding was set after you have consumed the stream.

Would it be helpful to throw this error at the start aswell. i.e. check the encoding before consuming the stream.

yeah, i was thinking about that. it's more of an error check for developers so i didn't think it was necessary to check it every time, but checking at the start shouldn't hurt.

8f9cc76

i only check in the beginning now. checking at the end would only be necessary if the user somehow sets the encoding while the stream is flowing.