Closed hakiKhuva closed 3 months ago
Not sure which problem this PR should fix. If there is a valid Content-Length
header, than reading one more byte should be blocked by the WSGI server and return nothing, which is exactly what is tested for here. But if the content length is unknown (-1
), we should read up to mem_limit
and fail if we detect that there is more data we cannot parse. This PR removed that check and may return incomplete results instead of failing, which I'd say is way worse than a clean exception.
removed line that read 1 next character from the
stream
and usingCONTENT_LENGTH
to read the content of thewsgi.input
orstream
variable.If the
CONTENT_LENGTH
is more than the memory limit than the error is raised before reading the content ofstream
.