From e3dc6199049631c2f617cdf1a81e2d46c461fc36 Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Wed, 7 Jun 2023 21:57:14 +0200 Subject: [PATCH] [Bugfix] Fix executor (#1327) --- pkg/util/arangod/conn/conn.executor.go | 4 ---- pkg/util/arangod/conn/factory.go | 10 ++++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/pkg/util/arangod/conn/conn.executor.go b/pkg/util/arangod/conn/conn.executor.go index 5d312593b..5804fd3a8 100644 --- a/pkg/util/arangod/conn/conn.executor.go +++ b/pkg/util/arangod/conn/conn.executor.go @@ -66,10 +66,6 @@ func (e executor[IN, OUT]) Execute(ctx context.Context, method string, endpoint defer resp.Close() - if err := resp.Close(); err != nil { - return nil, 0, err - } - var out OUT if err := json.NewDecoder(resp).Decode(&out); err != nil { diff --git a/pkg/util/arangod/conn/factory.go b/pkg/util/arangod/conn/factory.go index 063ddfd4b..480e44e37 100644 --- a/pkg/util/arangod/conn/factory.go +++ b/pkg/util/arangod/conn/factory.go @@ -73,11 +73,13 @@ func (f factory) RawConnection(host string) (Connection, error) { return nil, err } - if auth.Type() != driver.AuthenticationTypeRaw { - return nil, errors.Newf("Only RAW Authentication is supported") - } + if auth != nil { + if auth.Type() != driver.AuthenticationTypeRaw { + return nil, errors.Newf("Only RAW Authentication is supported") + } - authString = util.NewType(auth.Get("value")) + authString = util.NewType(auth.Get("value")) + } } return connection{