-
-
Notifications
You must be signed in to change notification settings - Fork 227
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
robyn request body processing problem #954
Labels
bug
Something isn't working
Comments
Hey @tqq1994516 👋 Thanks for raising this issue. @VishnuSanal can you have a look? Otherwise I can have a look by the weekend |
I am currently attempting to fix at https:/tqq1994516/Robyn/tree/fix-request-body-parsing and expect to submit the pull request by Friday. |
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Description
1.Improper handling of form information
2.The form contains a file and the form field contains the same field
3.
request.json()
Method serializes the result of a list field when the string of the list is not the list object,But expected when usingorjson.loads(request.body)
results4.The form contains files, and the corresponding fields cannot be obtained, and only the file name and file stream can be obtained
Steps to Reproduce
This is a sample server-side code
I got headers included
"content-type": ["application/x-www-form-urlencoded"]
,But the value I get when I use therequest.form_data
is{}
,request.body
can obtain the original request value2. For question 2, I use the following client code to make a request:
Now
form_data
I can try to get the value of type dict, but he only has the value of the last element in the list field{'title': '11', 'job_url': '11', 'display_env': 'version', 'robot_webhook': 'http://aa', 'build_num': '1'}
,request.body
contains all the values, but there is no field identifier and cannot be extracted3. For question 3, I use the following client code to make a request,At the same time, the annotation of the
request.json()
method on the server side is removed:The resulting list field is a string object containing the contents of the list rather than the list object
{'field': '["a","b","c"]', 'title': 'xxxx'}
, but the expected result{'title': 'xxxx', 'field': ['a', 'b', 'c']}
can be obtained by usingorjson.loads(request.body)
4. For question 4, I use the following client code to make a request:
When I use the same request as question 2 to get
request.files
, I can't get the field namejson
and only the file name.report.json
and file contents<class 'bytes'>
Your operating system
Linux
Your Python version (
python --version
)3.12
Your Robyn version
latest
Additional Info
I hope the above feedback can be answered, whether it is a problem I use or a bug in the framework
The text was updated successfully, but these errors were encountered: