From 7ba60a81b1f2429c9ed1d381367f547fa10ed14e Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Fri, 3 Jun 2016 18:28:17 +0200 Subject: Update ContentLength --- signer.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'signer.go') diff --git a/signer.go b/signer.go index f72cd3c..f9c0378 100644 --- a/signer.go +++ b/signer.go @@ -83,7 +83,9 @@ func (s Signer) RoundTrip(req *http.Request) (*http.Response, error) { if err != nil { return nil, err } - req.Body = ioutil.NopCloser(strings.NewReader(obj.FullSerialize())) + signed := obj.FullSerialize() + req.ContentLength = int64(len(signed)) + req.Body = ioutil.NopCloser(strings.NewReader(signed)) } resp, err := http.DefaultTransport.RoundTrip(req) if err != nil { -- cgit v1.2.3