internal: replace ioutils

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2022-08-08 21:00:45 +02:00
parent 7ea0b4b9e4
commit 6356ddd9f3
3 changed files with 10 additions and 14 deletions

View File

@ -1,7 +1,7 @@
package web
import (
"io/ioutil"
"io"
"net/http"
"github.com/gorilla/mux"
@ -43,12 +43,7 @@ func RunMetricsServer() {
l.WithError(err).Warning("failed to get upstream metrics")
return
}
bm, err := ioutil.ReadAll(res.Body)
if err != nil {
l.WithError(err).Warning("failed to get upstream metrics")
return
}
_, err = rw.Write(bm)
_, err = io.Copy(rw, res.Body)
if err != nil {
l.WithError(err).Warning("failed to get upstream metrics")
return