Signature-V4: Include content-length for signature calculation. (#2643)

This is to be compatible with clients which includes content-length for signature calculation
(and hence deviating from AWS Signature-v4 spec)
This commit is contained in:
Krishna Srinivas
2016-09-09 22:08:07 +05:30
committed by Harshavardhana
parent a4afb312d4
commit 400e9309f1
3 changed files with 56 additions and 2 deletions

View File

@@ -21,6 +21,7 @@ import (
"encoding/xml"
"errors"
"io"
"net/http"
"os"
"os/exec"
"strings"
@@ -30,6 +31,18 @@ import (
"github.com/pkg/profile"
)
// make a copy of http.Header
func cloneHeader(h http.Header) http.Header {
h2 := make(http.Header, len(h))
for k, vv := range h {
vv2 := make([]string, len(vv))
copy(vv2, vv)
h2[k] = vv2
}
return h2
}
// xmlDecoder provide decoded value in xml.
func xmlDecoder(body io.Reader, v interface{}, size int64) error {
var lbody io.Reader