diff --git a/pkg/eosclient/eosgrpc/eos_http/eoshttp.go b/pkg/eosclient/eosgrpc/eos_http/eoshttp.go index 6c1de631d1..35c35b8eab 100644 --- a/pkg/eosclient/eosgrpc/eos_http/eoshttp.go +++ b/pkg/eosclient/eosgrpc/eos_http/eoshttp.go @@ -408,15 +408,15 @@ func (c *Client) PUTFile(ctx context.Context, remoteuser, uid, gid, urlpath stri Transport: httpTransport} req, err = http.NewRequestWithContext(ctx, "PUT", loc.String(), stream) + if err != nil { + log.Error().Str("func", "PUTFile").Str("url", loc.String()).Str("err", err.Error()).Msg("can't create redirected request") + return err + } if length >= 0 { log.Debug().Str("func", "PUTFile").Int64("Content-Length", length).Msg("setting header") req.Header.Set("Content-Length", strconv.FormatInt(length, 10)) } - if err != nil { - log.Error().Str("func", "PUTFile").Str("url", loc.String()).Str("err", err.Error()).Msg("can't create redirected request") - return err - } log.Debug().Str("func", "PUTFile").Str("location", loc.String()).Msg("redirection") nredirs++