From ad9ee477909c7f42610fffa422f3af3e9b69ce77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81kos=20T=C3=B3th?= Date: Wed, 5 Aug 2015 09:51:48 +0200 Subject: [PATCH] Revert "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 0bd2e40..24a088d 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[0] { + for _, header := range headers { 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()))