diff options
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/mitmux/main.go | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/cmd/mitmux/main.go b/cmd/mitmux/main.go index 75f4410..83e59cd 100644 --- a/cmd/mitmux/main.go +++ b/cmd/mitmux/main.go @@ -1532,8 +1532,8 @@ func (m *model) detailView() string { b.WriteString(titleStyle.Render(title)) b.WriteString("\n") - reqLabel := fmt.Sprintf("Request (%d bytes%s)", len(m.detail.RequestRaw), exactSuffix(m.detail.RequestExact)) - respLabel := fmt.Sprintf("Response (%d bytes%s)", len(m.detail.ResponseRaw), exactSuffix(m.detail.ResponseExact)) + reqLabel := fmt.Sprintf("Request (%d bytes%s)", len(m.detail.RequestRaw), exactSuffix(m.detail.RequestExact, m.detail.RequestTruncated)) + respLabel := fmt.Sprintf("Response (%d bytes%s)", len(m.detail.ResponseRaw), exactSuffix(m.detail.ResponseExact, m.detail.ResponseTruncated)) if m.prettyMode { respLabel += " [pretty]" } @@ -1580,7 +1580,7 @@ func (m *model) repeaterView() string { reqLabel := "Request (editable)" respLabel := "Response" if t.result != nil { - respLabel = fmt.Sprintf("Response (%d bytes%s)", len(t.result.ResponseRaw), exactSuffix(t.result.ResponseExact)) + respLabel = fmt.Sprintf("Response (%d bytes%s)", len(t.result.ResponseRaw), exactSuffix(t.result.ResponseExact, t.result.ResponseTruncated)) } if t.focus == focusRequest { b.WriteString(tabActive.Render(reqLabel)) @@ -1783,11 +1783,20 @@ func intrudeRowsFor(rs []ipc.IntrudeResultMsg) []table.Row { return rows } -func exactSuffix(exact bool) string { - if exact { +// exactSuffix labels a capture's trust level. truncated is a distinct +// state from a plain "reconstructed" (HTTP/2, which never had wire-exact +// bytes to begin with): these ARE real wire bytes, just cut short by +// hitting the capture size cap - telling them apart matters for a tool +// whose value proposition is "raw bytes are the source of truth." +func exactSuffix(exact, truncated bool) string { + switch { + case exact: return ", exact" + case truncated: + return ", truncated (hit capture size limit)" + default: + return ", reconstructed" } - return ", reconstructed" } // detailContent is what actually gets shown in the detail viewport: |