-
-
Notifications
You must be signed in to change notification settings - Fork 273
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
Add response body in middlewares before and after request #297
Add response body in middlewares before and after request #297
Conversation
✅ Deploy Preview for robyn canceled.
|
✅ Deploy Preview for robyn canceled.
|
* `SocketHeld::new` refactor * Support both ipv4 and ipv6
* update rust packages to latest * fix clippy issues * fix package version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR @Shending-Help 😄
I have a few inline comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Shending-Help , can you please add one integration test to confirm the working of everything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some more inline comments on the PR. Thanks again 😄
@Shending-Help , there are some conflicts now. Apologies . |
@sansyrox removed all dead code and addressed all comments and resolved the merge conflicts |
Thanks @Shending-Help . Great work 😄 I will have a look tomorrow morning, Indian time. |
@Shending-Help , can you please add one integration test too? I think you may have missed this comment. I'll still do a first review tomorrow morning 😄
|
response_dict.insert("headers", response_headers.into_py(py)); | ||
response_dict.insert("status", response_status_code.into_py(py)); | ||
response_dict.insert("body", response_body.into_py(py)); | ||
|
||
let output: PyResult<&PyAny> = match number_of_params { | ||
0 => handler.call0(), | ||
1 => handler.call1((request,)), | ||
2 => handler.call1((request, response_dict)), | ||
// this is done to accomodate any future params | ||
2_u8..=u8::MAX => handler.call1((request,)), | ||
3_u8..=u8::MAX => handler.call1((request, response_dict)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks great. Just one last nit:
request
and response_dict
do not match. Can you rename them to request
and response
or req
and res
or request_dict
and response_dict
?
f795e5a
to
0d994ea
Compare
ee6866d
to
3ef0cdb
Compare
These have been implemented now. Hence, closing the PR |
Description
This PR fixes the issue with request body not being accessible in the middlewares and add a new feature of having the response object accessible in the before and after request middlwares
This PR fixes #244