mitmproxy
mitmproxy copied to clipboard
Console: Make it easier to edit binary contents
Problem Description
Right now, editing a request or response body opens the default text editor. This is a bad choice for binary formats, which should much rather be opened in a hex editor.
Steps to reproduce the behavior:
- Make an HTTP request to a binary file, e.g.
https://www.google.com/favicon.ico
- Edit the response body in mitmproxy.
Proposed Fix
- Assemble a list of console-based hex editors and order them by usefulness.
- Adjust
ConsoleMaster.spawn_editor
to detect binary contents and then spawn a hex editor instead.
We already have a function to detect if contents are binary in mitmproxy.utils.strutils
.