Skip to content

Commit

Permalink
Merge pull request #42 from DaytonG/master
Browse files Browse the repository at this point in the history
set send frame details earlier
  • Loading branch information
worg committed Jul 9, 2018
2 parents ba86090 + b374638 commit 10a97af
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions conn.go
Expand Up @@ -445,6 +445,10 @@ func createSendFrame(destination, contentType string, body []byte, opts []func(*
// an opportunity to remove content-length.
f := frame.New(frame.SEND, frame.ContentLength, strconv.Itoa(len(body)))
f.Body = body
f.Header.Set(frame.Destination, destination)
if contentType != "" {
f.Header.Set(frame.ContentType, contentType)
}

for _, opt := range opts {
if opt == nil {
Expand All @@ -455,12 +459,6 @@ func createSendFrame(destination, contentType string, body []byte, opts []func(*
}
}

f.Header.Set(frame.Destination, destination)

if contentType != "" {
f.Header.Set(frame.ContentType, contentType)
}

return f, nil
}

Expand Down

0 comments on commit 10a97af

Please sign in to comment.