-
Notifications
You must be signed in to change notification settings - Fork 6
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
parse_part
dropping any instance of \r\n
#17
Comments
@sgrove it seems like you handled this and other issues in your fork. Maybe you could PR it if it's been working for you so far? |
Right, sorry for not answering before. As mentioned in #16 I'm not super convinced about the current API, and this package will probably go through significant changes, but that shouldn't prevent it from being correct :) If you have a working patch I'm happy to merge it. Thanks! |
This has become very relevant for me. I'll see if I can address that issue. |
I'm not a maintainer anymore, but if this package does not work, you might want to try https://github.com/dinosaure/multipart_form (not released yet). |
Thanks. I decided for a direct API call instead, but I'll take a look if I decide to use |
I also suspect that handling of |
Took awhile to track this down, but our binary uploads may contain
\r\n
in the file bodies somewhere, and it looks like Multipart is stripping every instance, leading to invalid files being stored to disk.It looks like it might be here https://github.com/cryptosense/multipart-form-data/blob/master/lib/multipart.ml#L163 where all of the lines, having been split on
\r\n
, are simply concatenated together as-is, not restoring the\r\n
that was there beforehand (to be clear, we need the bytes0d0a
to be in the final filestream).I tried a few different hacks, but I'm not very familiar with
Lwt_stream
, and couldn't quite figure out how best to get it to interpose the streams I need. Any hints on how to make it work?The text was updated successfully, but these errors were encountered: