Open BlrSystem opened 2 weeks ago
Hello, i investigated the issue submitted by op
It looks like an actual boundary is generated by actix/awc but not added to the header (not sure if this is the fault of actix/awc i am not an web expert by anymeans. my common sense says that it's weird at the very least)
Stepping forward with the debugger you can see that it then tries to parse some headers from "Content-Disposition" and then access the "name" attribute which does not exist. Hence the segmentation.
I'd say it's a combination of mistakes. What fixed things for me was to return in the "parse_body" method when the boundary was empty
Judging from the fact that the error gets to the user's handler and he is parsing the headers manually i would say that this is intended and maybe throwing an exception is desired. Also adding a unit test for this case would be nice
Let me know what you think i'd be happy to help with both :)
I agree, the missing boundary is a malformed request, therefore leaving function with raising an exception may be the appropriate reaction. If you would want to spent time on the bugfix and testing I would be happy.
@Iuliean Thank you very much for your debug! Yes, the missing boundary is a malformed request and it shouldn't happen, anyway raising an exception could be great.
Implementing a file upload request from rust using awc::Client and actix_multipart_rfc7578::client::multipart to a crow server, I forgot to set the Content-Type header returned by multipart::Form::default(), leaving it with only the value “multipart/form-data”.
Rust bad request example
Crow server
Rust good example
Crow server workaround