From 7a56597a5f1252425dafd2646fae983d161e69c9 Mon Sep 17 00:00:00 2001 From: Artem Puzanov Date: Wed, 9 Sep 2020 13:31:17 +0200 Subject: [PATCH] Fix incorrect string to int conversion --- analytics.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/analytics.go b/analytics.go index d0f089f..b713c29 100644 --- a/analytics.go +++ b/analytics.go @@ -4,6 +4,7 @@ import ( "fmt" "io" "io/ioutil" + "strconv" "sync" "bytes" @@ -291,7 +292,7 @@ func (c *client) upload(b []byte) error { req.Header.Add("User-Agent", "analytics-go (version: "+Version+")") req.Header.Add("Content-Type", "application/json") - req.Header.Add("Content-Length", string(len(b))) + req.Header.Add("Content-Length", strconv.Itoa(len(b))) req.SetBasicAuth(c.key, "") res, err := c.http.Do(req)