Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for auto parsing http gzip response content #260

Open
hengyoush opened this issue Jan 9, 2025 · 0 comments
Open

Support for auto parsing http gzip response content #260

hengyoush opened this issue Jan 9, 2025 · 0 comments
Labels
enhancement New feature or request feature-request good first issue Good for newcomers tui terminal ui related

Comments

@hengyoush
Copy link
Owner

Is your feature request related to a problem? Please describe.
Currently, the response content captured by Kyanos in gzip format is not decompressed. It would be beneficial to automatically decompress the content when the HTTP header Content-Encoding: gzip is set.

Describe the solution you'd like
Decompressing the content would be particularly useful when users want to view it in the watch table (but not during the protocol parsing phase). For implementation details, you can refer to the source file: agent/render/watch/watch_render.go:

case "enter":
m.chosen = true
if m.chosen {
selected := m.table.SelectedRow()
if selected != nil {
idx, _ := strconv.Atoi(selected[0])
r := (*m.records)[idx-1]
line := strings.Repeat("+", m.viewport.Width)
timeDetail := ViewRecordTimeDetailAsFlowChart(r)
// m.viewport.SetContent("[Request]\n\n" + c.TruncateString(r.Req.FormatToString(), 1024) + "\n" + line + "\n[Response]\n\n" +
// c.TruncateString(r.Resp.FormatToString(), 10240))
m.viewport.SetContent(
timeDetail + "\n" + line + "\n" +
r.String(common.AnnotatedRecordToStringOptions{
Nano: false,
MetricTypeSet: common.MetricTypeSet{common.TotalDuration: true},
IncludeConnDesc: true,
}) + "\n" + line + "\n" +
"[Request]\n\n" + c.TruncateString(r.Req.FormatToString(), m.options.MaxRecordContentDisplayBytes) + "\n" + line +
"\n[Response]\n\n" + c.TruncateString(r.Resp.FormatToString(), m.options.MaxRecordContentDisplayBytes))

Describe alternatives you've considered
None.

Additional context
None.

@hengyoush hengyoush added enhancement New feature or request good first issue Good for newcomers tui terminal ui related labels Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature-request good first issue Good for newcomers tui terminal ui related
Projects
None yet
Development

No branches or pull requests

1 participant