From 6240d85377481302da36e225d6348fbea77855fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=2E=20Mert=20Y=C4=B1ld=C4=B1ran?= Date: Tue, 19 Oct 2021 16:22:47 +0300 Subject: [PATCH] Bring back the lines that didn't meant to be removed (#375) --- tap/extensions/http/handlers.go | 9 +++++++++ 1 file changed, 9 insertions(+) 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,