mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-08 05:09:46 -06:00
Revert "Replace ioutil.ReadAll with a buffered decoder"
This reverts commit 05e314ed1f.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user