Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions httphmac/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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()))
Expand Down