You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @shimakaze-git !
I would like to claim that this is not a bug, but a breaking change in Falcon 2.0.
For performance reasons, we are no longer wrapping req.stream with BoundedStream. BoundedStream helps to normalize the behaviour across various WSGI server implementations, including somewhat glitchy ones.
This is documented together with other breaking changes, see the note about falcon.Request.stream.
The wrapped stream is available as resp.bounded_stream. I have modified your example to get it to work the way you may have expected:
@@ -2,8 +2,8 @@
class SampleResource(object):
def on_post(self, req, resp):
- data = req.stream.read()- return {'status': 'ok'}+ data = req.bounded_stream.read()+ resp.media = {'status': 'ok'}
app = falcon.API()
app.add_route("/", SampleResource())
Let us know if you experience the documentation note as unclear though! We can improve it for the final release if this is the case.
Hi, I might have found a bug on 2.0.0a1 version.
I tried this code on 2.0.0a1 version.
but, Processing stops on 'req.stream.read()', there is no response.
I executed this curl command.but, No response is returned.
The text was updated successfully, but these errors were encountered: