feat(): support multipart mixed
Description
This is a fix in order to support multipart mixed content-type. It's quite similar to multipart/form-data, but as Form-Data and Axios are forcing a content-type change, patching is needed.
Reported in https://github.com/usebruno/bruno/issues/4178
Contribution Checklist:
- [X] The pull request only addresses one issue or adds one feature.
- [X] The pull request does not introduce any breaking changes
- [x] I have added screenshots or gifs to help explain the change if applicable.
- [X] I have read the contribution guidelines.
- [x] Create an issue and link to the pull request.
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.
Publishing to New Package Managers
Please see here for more information.
Hey @alfonso-presa, I reviewed the PR, and there are still one issue. The environment variables are not being interpolated in the response. If the Content-Type is multipart/mixed.
@pooja-bruno , I think it's fixed now. Please let me know if this way of solving it is good (I think some other multipart content types like alternative, digest, and so can take advantage of this....) or if you'd rather see an specific execution branch for mixed content-type.
Thanks!
Btw.... following my previous comment. If you'd like me to add an request.headers['content-type'].startsWith('multipart/') as an else if of the current "form-data" implementation so that it not only supports the mixed content-type, but it also does a best effort for other multipart subtypes just let me know and I'll do it right away.
Thanks for the suggestion, @alfonso-presa. I like the idea of using request.headers['content-type'].startsWith('multipart/') for more general support. Please update the PR with this change. Thanks!
Done @pooja-bruno! I've also done some refactor to do it more "D.R.Y". I was trying to avoid changing current core as much as possible to avoid any impact, but I think it now have sense to do it changing the current multipart/form-data code... Let me know if you agree or if I should do it in an else if fashion.
May I do something or help anyway to speed up the merge of this PR? I would patiently wait anyway :-). Keep it up!
Thanks!
@pooja-bruno, @Its-treason... I'm sorry to bother, I just want to ensure this has not been misplaced. Thanks!
Hi, This PR is in the review pipeline. Thanks for your patience.