prepare options
Some checks failed
lint / lint (pull_request) Failing after 1m20s
test / test (pull_request) Successful in 1m59s

This commit is contained in:
2025-02-21 20:13:34 +03:00
parent c031230888
commit 334a10e26d
2 changed files with 20 additions and 52 deletions

View File

@@ -6,7 +6,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"net"
"net/http"
"net/url"
@@ -199,7 +199,7 @@ func newRequest(ctx context.Context, log logger.Logger, addr string, req client.
var hreq *http.Request
if len(b) > 0 {
hreq, err = http.NewRequestWithContext(ctx, method, u.String(), ioutil.NopCloser(bytes.NewBuffer(b)))
hreq, err = http.NewRequestWithContext(ctx, method, u.String(), io.NopCloser(bytes.NewBuffer(b)))
hreq.ContentLength = int64(len(b))
header.Set("Content-Length", fmt.Sprintf("%d", hreq.ContentLength))
} else {