From 7a44d87437e31dabb757fd9878ae29ccc0dfc091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81kos=20T=C3=B3th?= Date: Wed, 5 Aug 2015 09:51:36 +0200 Subject: [PATCH] Revert "minor fix" --- httphmac/message.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/httphmac/message.go b/httphmac/message.go index 24a088d..0bd2e40 100644 --- a/httphmac/message.go +++ b/httphmac/message.go @@ -45,11 +45,11 @@ type Message struct { // NewMessage returns a new Message given a HTTP request, and an array of // custom headers used in the HMAC signature generation. -func NewMessage(r *http.Request, headers ...string) *Message { +func NewMessage(r *http.Request, headers ...[]string) *Message { h := NewHeaders() if len(headers) > 0 { - for _, header := range headers { + for _, header := range headers[0] { h.Set(header, r.Header.Get(header)) } } @@ -91,7 +91,7 @@ func NewRawMessage(method string, body string, contentType string, date string, uri, _ := url.Parse(path) uri.Path = strings.TrimRight(uri.Path, "/") - return &Message{ + return &Message { method, HashData([]byte(body)), contentType, @@ -121,7 +121,7 @@ func (m *Message) Bytes() []byte { b.Write(m.CustomHeaders.Bytes()) - if m.trailingSlash { + if (m.trailingSlash) { b.WriteString(m.Resource.RequestURI()) } else { b.WriteString(removeTrailingSlash(m.Resource.RequestURI()))