Use older ioutil package for compatibility

This commit is contained in:
Ice3man543 2021-08-25 14:19:46 +05:30
parent d8b9172559
commit 63bc417398

View File

@ -4,7 +4,7 @@ import (
"bytes" "bytes"
"crypto/tls" "crypto/tls"
"fmt" "fmt"
"io" "io/ioutil"
"net/http" "net/http"
"time" "time"
@ -101,10 +101,10 @@ func (i *Exporter) Export(event *output.ResultEvent) error {
if err != nil { if err != nil {
return err return err
} }
req.Body = io.NopCloser(bytes.NewReader(b)) req.Body = ioutil.NopCloser(bytes.NewReader(b))
res, err := i.elasticsearch.Do(req) res, err := i.elasticsearch.Do(req)
b, _ = io.ReadAll(res.Body) b, _ = ioutil.ReadAll(res.Body)
if err != nil { if err != nil {
return errors.New(err.Error() + "error thrown by elasticsearch " + string(b)) return errors.New(err.Error() + "error thrown by elasticsearch " + string(b))
} }