mitmproxy
mitmproxy copied to clipboard
Fix Multipart content view parsing
Description
On get_message_content_view, the content type wasn't including the boundary, and was only setting the MIME type. This made the multipart content view unusable, as the boundary was required on parsing. To fix the issue, we assign the full content type instead.
This wasn't triggered by any previous tests because they would test against the multipart parser directly, and not the generic parser.
Checklist
- [X] I have updated tests where applicable.
- [x] I have added an entry to the CHANGELOG.
I'm not sure why the check is failing?
https://github.com/mitmproxy/mitmproxy/actions/runs/7878070568/job/21495523975?pr=6653#step:5:74
Test is failing because test_multipart
is not covering line 17. Only test_api does. We are (a bit too) strict here...
Cheap fix is to list http_message directly as an arg and then not have any branches: https://github.com/mitmproxy/mitmproxy/blob/1a02ebb89f6765d827f2fe0086dfe5960eb6e093/mitmproxy/contentviews/query.py#L8-L12
Thanks for the quick RTT! 🍰
This PR should be good now!