test: NewUsingIAM mock
This commit is contained in:
@@ -129,13 +129,15 @@ func writeHeaderList(w io.Writer, r *http.Request) {
|
||||
}
|
||||
|
||||
func writeBody(w io.Writer, r *http.Request) {
|
||||
var b []byte
|
||||
var (
|
||||
b []byte
|
||||
err error
|
||||
)
|
||||
// If the payload is empty, use the empty string as the input to the SHA256 function
|
||||
// http://docs.amazonwebservices.com/general/latest/gr/sigv4-create-canonical-request.html
|
||||
if r.Body == nil {
|
||||
b = []byte("")
|
||||
} else {
|
||||
var err error
|
||||
b, err = ioutil.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
||||
Reference in New Issue
Block a user