mirror of
https://github.com/openfaas/faas.git
synced 2025-06-23 07:13:23 +00:00
chore: remove refs to deprecated io/ioutil
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
This commit is contained in:
@ -4,7 +4,6 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/openfaas/faas-provider/types"
|
"github.com/openfaas/faas-provider/types"
|
||||||
@ -66,7 +65,7 @@ func MakeHorizontalScalingHandler(next http.HandlerFunc) http.HandlerFunc {
|
|||||||
|
|
||||||
upstreamReq, _ := json.Marshal(scaleRequest)
|
upstreamReq, _ := json.Marshal(scaleRequest)
|
||||||
// Restore the io.ReadCloser to its original state
|
// Restore the io.ReadCloser to its original state
|
||||||
r.Body = ioutil.NopCloser(bytes.NewBuffer(upstreamReq))
|
r.Body = io.NopCloser(bytes.NewBuffer(upstreamReq))
|
||||||
|
|
||||||
next.ServeHTTP(w, r)
|
next.ServeHTTP(w, r)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user