mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
fix: explicitly signaling when a net.sniff'ed http form is empty
This commit is contained in:
parent
9533c67d88
commit
868aba8de0
1 changed files with 6 additions and 2 deletions
|
@ -140,8 +140,12 @@ func (s *EventsStream) viewSnifferEvent(e session.Event) {
|
|||
|
||||
if err := req.ParseForm(); err == nil {
|
||||
misc += " \n Form:\n\n"
|
||||
for key, values := range req.Form {
|
||||
misc += fmt.Sprintf(" %s => %s\n", core.Green(key), core.Bold(strings.Join(values, ", ")))
|
||||
if len(req.Form) == 0 {
|
||||
misc += fmt.Sprintf(" %s\n", core.Dim("<empty>"))
|
||||
} else {
|
||||
for key, values := range req.Form {
|
||||
misc += fmt.Sprintf(" %s => %s\n", core.Green(key), core.Bold(strings.Join(values, ", ")))
|
||||
}
|
||||
}
|
||||
} else if req.Body != nil {
|
||||
b, _ := ioutil.ReadAll(req.Body)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue