From b49126e234d6ffdade5f3f9b3fa560c38fe4c112 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Mon, 5 Oct 2020 14:59:27 +0200 Subject: [PATCH] Revert "Replace ioutil.ReadAll with a buffered decoder" This reverts commit 05e314ed1fce5c69db544262d377cf8357d8d8ce. --- accounts/pkg/storage/cs3.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/accounts/pkg/storage/cs3.go b/accounts/pkg/storage/cs3.go index d8b1c7fc97..5fce0839c0 100644 --- a/accounts/pkg/storage/cs3.go +++ b/accounts/pkg/storage/cs3.go @@ -5,6 +5,7 @@ import ( "context" "encoding/json" "io" + "io/ioutil" "net/http" "path" "strings" @@ -92,9 +93,8 @@ func (r CS3Repo) LoadAccount(ctx context.Context, id string, a *proto.Account) ( return ¬FoundErr{"account", id} } - dec := json.NewDecoder(resp.Body) - var b []byte - if err = dec.Decode(&b); err != nil { + b, err := ioutil.ReadAll(resp.Body) + if err != nil { return err } if err = resp.Body.Close(); err != nil { @@ -167,9 +167,8 @@ func (r CS3Repo) LoadGroup(ctx context.Context, id string, g *proto.Group) (err return ¬FoundErr{"group", id} } - dec := json.NewDecoder(resp.Body) - var b []byte - if err = dec.Decode(&b); err != nil { + b, err := ioutil.ReadAll(resp.Body) + if err != nil { return err } if err = resp.Body.Close(); err != nil {