Skip to content

Console: Make it easier to edit binary contents #5231

@mhils

Description

@mhils

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:

  1. Make an HTTP request to a binary file, e.g. https://www.google.com/favicon.ico
  2. Edit the response body in mitmproxy.

Proposed Fix

  1. Assemble a list of console-based hex editors and order them by usefulness.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions