diff options
| author | srdusr <[email protected]> | 2026-02-24 19:30:00 +0200 |
|---|---|---|
| committer | srdusr <[email protected]> | 2026-02-24 19:30:00 +0200 |
| commit | 66d00f513e30d0746c1d5b4cd3b0c4a34a243928 (patch) | |
| tree | 37d785dbe2b0541ae7215969584d9d582a96bf37 /go.mod | |
| parent | 5200e412606c221fb618bd8e9a57a897553215d9 (diff) | |
| download | mitmux-66d00f513e30d0746c1d5b4cd3b0c4a34a243928.tar.gz mitmux-66d00f513e30d0746c1d5b4cd3b0c4a34a243928.zip | |
Comparer: unified diff between two history entries
Next item off the "worth considering" list from the Burp/ZAP/Caido gap
research. Mark an entry with 'c' (from the history list or detail
view - no fetch yet, just remembers the ID), then 'c' on a different
entry fetches both and opens a colored unified diff of either side's
request or response, tab to switch between them.
Unified (git-diff style: +/- prefixed lines) rather than Burp's
side-by-side two-pane layout - a two-column view fights terminal width
for anything but a wide window, and unified reuses the same scrollable
viewport pattern already used everywhere else in this TUI rather than
needing new layout machinery. Uses github.com/pmezard/go-difflib
(SequenceMatcher-based, a tested port of Python's difflib) rather than
hand-rolling LCS/Myers diff, which has real edge cases worth not
reinventing. CRLF is normalized to LF before diffing - display-only,
same reasoning as the JSON pretty-printer - so an HTTP/1.1 exact
capture doesn't show every single line as changed purely from an
invisible trailing \r.
Verified live against two real, distinctly different captured POST
requests (different form bodies, different Content-Length): the request
diff correctly isolated exactly the two changed lines with the
unchanged headers shown as context, colors confirmed via raw ANSI
codes in the captured pane output (red 203 for removed, green 42 for
added) rather than assumed from the code, and the response tab showed
a correct independent diff of the two responses (Date header, JSON
body). Also confirmed the "same entry marked twice" path shows a hint
rather than silently doing something confusing.
Diffstat (limited to 'go.mod')
| -rw-r--r-- | go.mod | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -6,6 +6,7 @@ require ( github.com/charmbracelet/bubbles v1.0.0 github.com/charmbracelet/bubbletea v1.3.10 github.com/charmbracelet/lipgloss v1.1.0 + github.com/pmezard/go-difflib v1.0.0 golang.org/x/net v0.58.0 modernc.org/sqlite v1.56.0 ) |