Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Support wsgi.input_terminated flag #1664
(Assuming CherryPy supports chunked transfer encoding, I'm not directly familiar with this WSGI server / client.) Unfortunately the WSGI spec has no support for it. A standard was proposed by @mitsuhiko here: https://gist.github.com/mitsuhiko/5721547. If the WSGI server supports streams without a content length, it should set
@davidism CherryPy already ignores Content-Length in case of chunked transfer encoding: https://github.com/cherrypy/cherrypy/blob/9d95d40/cherrypy/_cpreqbody.py#L449
Also, the whole WSGI/HTTP layer has been moved to separate repo Cheroot a while ago. So the issue looks related to that project, not CherryPy itself.
@jaraco do you have any insights on this?
The idea is for the server to be able to communicate to the client that the input is already terminated. So if someone wants to use the CherryPy WSGI server for their Flask app (an example I come across occasionally), Flask (Werkzeug) knows it can safely read the stream even though there's no content length.
It looks like CherryPy assumes the WSGI server will terminate input correctly, but this isn't the case for all servers. This proposal gives us a way for the server to explicitly state that it is safe to read the stream without a length, instead of the client needing to make assumptions.
In CherryPy's case, if cheroot handles reading chunked encoding, it should set