diff --git a/tap/extensions/http/handlers.go b/tap/extensions/http/handlers.go index 3cfe98588..6b670da8f 100644 --- a/tap/extensions/http/handlers.go +++ b/tap/extensions/http/handlers.go @@ -2,7 +2,10 @@ package main import ( "bufio" + "bytes" "fmt" + "io" + "io/ioutil" "net/http" "github.com/up9inc/mizu/tap/api" @@ -84,6 +87,9 @@ func handleHTTP1ClientStream(b *bufio.Reader, tcpID *api.TcpID, counterPair *api } counterPair.Request++ + body, err := ioutil.ReadAll(req.Body) + req.Body = io.NopCloser(bytes.NewBuffer(body)) // rewind + ident := fmt.Sprintf( "%s->%s %s->%s %d", tcpID.SrcIP, @@ -113,6 +119,9 @@ func handleHTTP1ServerStream(b *bufio.Reader, tcpID *api.TcpID, counterPair *api } counterPair.Response++ + body, err := ioutil.ReadAll(res.Body) + res.Body = io.NopCloser(bytes.NewBuffer(body)) // rewind + ident := fmt.Sprintf( "%s->%s %s->%s %d", tcpID.DstIP,