Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,11 @@ func makeListener(ctx context.Context, requestURL string, opts options) func(int
return
}

body := "none"
if ev.Request.HasPostData {
body = ev.Request.PostData
}

err := chromedp.Run(
ctx,
chromedp.ActionFunc(func(ctx context.Context) error {
Expand All @@ -357,7 +362,7 @@ func makeListener(ctx context.Context, requestURL string, opts options) func(int
}

// Log the request
fmt.Printf("%s %s %d %s\n", ev.Request.Method, ev.Request.URL, ev.ResponseStatusCode, contentType)
fmt.Printf("%s %s %d %s %s\n", ev.Request.Method, ev.Request.URL, ev.ResponseStatusCode, strings.ReplaceAll(contentType, " ", ""), url.QueryEscape(body)) // replace spaces for easier awk

return nil
}),
Expand Down