From 523ed67dc2d0f800efc68d414b37bb001535d3ee Mon Sep 17 00:00:00 2001 From: therealbobo Date: Sat, 12 Sep 2020 17:40:02 +0200 Subject: added decoded_content field --- connection_streams_controller.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/connection_streams_controller.go b/connection_streams_controller.go index 000e3d4..096210e 100644 --- a/connection_streams_controller.go +++ b/connection_streams_controller.go @@ -27,6 +27,7 @@ type PatternSlice [2]uint64 type Payload struct { FromClient bool `json:"from_client"` Content string `json:"content"` + DecodedContent string `json:"decoded_content"` Index int `json:"index"` Timestamp time.Time `json:"timestamp"` IsRetransmitted bool `json:"is_retransmitted"` @@ -92,6 +93,7 @@ func (csc ConnectionStreamsController) GetConnectionPayload(c context.Context, c payload = Payload{ FromClient: true, Content: DecodeBytes(clientStream.Payload[start:end], format.Format), + //Request: ReadRequest(content), Index: start, Timestamp: clientStream.BlocksTimestamps[clientBlocksIndex], IsRetransmitted: clientStream.BlocksLoss[clientBlocksIndex], @@ -111,14 +113,14 @@ func (csc ConnectionStreamsController) GetConnectionPayload(c context.Context, c size := uint64(end - start) content := DecodeBytes(serverStream.Payload[start:end], format.Format) - // check if is encoded - if format.Format == "default" { - content = DecodeHttpResponse(content) - } + + plainContent := DecodeBytes(serverStream.Payload[start:end], "default") + decodedContent := DecodeBytes([]byte(DecodeHttpResponse(plainContent)), format.Format) payload = Payload{ FromClient: false, Content: content, + DecodedContent: decodedContent, Index: start, Timestamp: serverStream.BlocksTimestamps[serverBlocksIndex], IsRetransmitted: serverStream.BlocksLoss[serverBlocksIndex], -- cgit v1.2.3-70-g09d2