From b6db64d86848fdf81dd8921a2ff86817a6c73412 Mon Sep 17 00:00:00 2001 From: RoyUP9 <87927115+RoyUP9@users.noreply.github.com> Date: Wed, 20 Oct 2021 12:25:31 +0300 Subject: [PATCH] fixed sync entries text (#383) --- agent/pkg/up9/main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/agent/pkg/up9/main.go b/agent/pkg/up9/main.go index 012715701..7f8673e72 100644 --- a/agent/pkg/up9/main.go +++ b/agent/pkg/up9/main.go @@ -3,6 +3,7 @@ package up9 import ( "bytes" "compress/zlib" + "encoding/base64" "encoding/json" "fmt" "io/ioutil" @@ -231,6 +232,12 @@ func syncEntriesImpl(token string, model string, envPrefix string, uploadInterva harEntry.Request.Headers = append(harEntry.Request.Headers, har.Header{Name: "x-mizu-destination", Value: data.ResolvedDestination}) harEntry.Request.URL = utils.SetHostname(harEntry.Request.URL, data.ResolvedDestination) } + + // go's default marshal behavior is to encode []byte fields to base64, python's default unmarshal behavior is to not decode []byte fields from base64 + if harEntry.Response.Content.Text, err = base64.StdEncoding.DecodeString(string(harEntry.Response.Content.Text)); err != nil { + continue + } + result = append(result, *harEntry) }