Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing request.form in a @app.listen("request") raises a LazyBody error. #171

Closed
Natim opened this issue Sep 18, 2020 · 1 comment · Fixed by #227
Closed

Accessing request.form in a @app.listen("request") raises a LazyBody error. #171

Natim opened this issue Sep 18, 2020 · 1 comment · Fixed by #227

Comments

@Natim
Copy link

Natim commented Sep 18, 2020

I don't really know if it is a bug or a feature.

I was logging the request parameters using a @app.listen(request) decorator but at this point the request.body is not loaded yet.
I changed it for @app.listen("response")

@yohanboniface
Copy link
Member

I'd say it's a bug.

Semantically, the signal request should provide a full usable request. But we need a way to intercept the request without loading the body, and the plan is to add a headers signal that is sent once headers are fully parsed (so one can check auth and such at this moment, without dealing with the body).

Here is the original PR, and what we should implement back I think: https://github.com/pyrates/roll/pull/77/files#diff-2b45f513911dff50c92a6d00c244b62aR62-R70

cc @davidbgk I'll try to have a look but I'm not sure I'll have time this week so if you have a slot, go for it :)

Thanks for the report @Natim :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants