From cee15970fb72e8206608538b18b28dfa5c03ee81 Mon Sep 17 00:00:00 2001 From: Krishna Srinivas Date: Sun, 23 Apr 2017 18:53:33 -0700 Subject: [PATCH] Use UNSIGNED-PAYLOAD if sha256 is not calculated --- api.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/api.go b/api.go index fdbbb27e6..da4d584e8 100644 --- a/api.go +++ b/api.go @@ -659,9 +659,7 @@ func (c Client) newRequest(method string, metadata requestMetadata) (req *http.R // Set sha256 sum for signature calculation only with signature version '4'. shaHeader := unsignedPayload if !c.secure { - if metadata.contentSHA256Bytes == nil { - shaHeader = hex.EncodeToString(sum256([]byte{})) - } else { + if len(metadata.contentSHA256Bytes) > 0 { shaHeader = hex.EncodeToString(metadata.contentSHA256Bytes) } }